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?
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
server { listen 80; server_name test.com; rewrite ^(.*)$ https://$host$1 permanent; }
server { listen 80; server_name xx.com; rewrite ^(.*)$ https://$server_name permanent; }
That’s it.
How to configure SSL certificate on Nginx (LNMP) and enable forced HTTPShttps://echo.pm/lnmp-nginx-ss...
HSTS, it’s difficult to type on a mobile phone, so I won’t describe it
Isn’t this method good enough?
This is also possible
That’s it.
How to configure SSL certificate on Nginx (LNMP) and enable forced HTTPS
https://echo.pm/lnmp-nginx-ss...
HSTS, it’s difficult to type on a mobile phone, so I won’t describe it