# Redirect http to https

**URL:** <https://discuss.konghq.com/t/redirect-http-to-https/305>\
**Category:** Questions\
**Created:** [December 25, 2017, 8:45pm UTC](https://discuss.konghq.com/t/redirect-http-to-https/305 "2017-12-25T20:45:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![siavash](https://avatars.discourse-cdn.com/v4/letter/s/eada6e/32.png) [@siavash](https://discuss.konghq.com/u/siavash)\
**Post date:** [December 25, 2017, 8:45pm UTC](https://discuss.konghq.com/t/redirect-http-to-https/305/1 "2017-12-25T20:45:27Z")

</div>

Hi,

how can I redirect all http connections to https? I’ve done what has been said in this [GH issue](https://github.com/Kong/kong/issues/1946)  
but it’s not working!

here is my nginx custom template (just like the original):

```auto
worker_processes ${{NGINX_WORKER_PROCESSES}}; # can be set by kong.conf
daemon ${{NGINX_DAEMON}}; # can be set by kong.conf

pid pids/nginx.pid; # this setting is mandatory
error_log logs/error.log ${{LOG_LEVEL}}; # can be set by kong.conf

events {
    use epoll; # custom setting
    multi_accept on;
}

http {
    # include default Kong Nginx config
    include 'nginx-kong.conf';

    # custom server
    server {
        listen 80 default_server;
        listen [::]:80 default_server;
        server_name _;
        return 301 https://$host$request_uri;
    }
}

```

and I ran the following command `kong start --nginx-conf /kong-custom.conf` but nothing happened.

Thanks.

---

<div class="post-metadata">

**Author:** ![hbagdi](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.konghq.com/hbagdi/32/562_2.png) [@hbagdi](https://discuss.konghq.com/u/hbagdi)\
**Post date:** [May 3, 2019, 3:34pm UTC](https://discuss.konghq.com/t/redirect-http-to-https/305/2 "2019-05-03T15:34:44Z")

</div>

To share an update and for others who stumble across this, with [https://github.com/Kong/kong/pull/4424](https://github.com/Kong/kong/pull/4424) merged in, Kong 1.2 comes with support for sending HTTPS redirect out of the box in Kong.
