I am trying to reroute from http to https. For example you visit example.com and you will be automatically redirected to https://example.com.
I tryed using this one:
server {
listen 80;
return 301 https://$host$request_uri;
}
as well as this one:
server {
listen 80;
server_name example.com;
return 301 https://$server_name$request_uri;
}
as found here : In Nginx, how can I rewrite all http requests to https while maintaining sub-domain?
But neither of seem are wokring for me. I am staying on example.com.
Anyone got an idea?
Comments
Post a Comment