nginx makes port 80 forcefully jump to port 443.
Apart from,
server {
listen 80;
server_name file.demosite.com;
return 301 https://file.demosite.com $request_uri;
}
Is there any other way to force http to jump to https?
滿天的星座2017-05-16 17:17:07
Isn’t this method good enough?
server {
listen 80;
server_name file.demosite.com;
location / {
rewrite ^/(.*) https://file.demosite.com/ redirect;
}
}
This is also possible
大家讲道理2017-05-16 17:17:07
server {
listen 80;
server_name test.com;
rewrite ^(.*)$ https://$host$1 permanent;
}
淡淡烟草味2017-05-16 17:17:07
server {
listen 80;
server_name xx.com;
rewrite ^(.*)$ https://$server_name permanent;
}
That’s it.
巴扎黑2017-05-16 17:17:07
How to configure SSL certificate on Nginx (LNMP) and enable forced HTTPS
https://echo.pm/lnmp-nginx-ss...
曾经蜡笔没有小新2017-05-16 17:17:07
HSTS, it’s difficult to type on a mobile phone, so I won’t describe it