I am trying to force https for a site whenever someone goes to the http of the site. I am running nginx, I also have ispconfig 3.0.5.1 I have tried: return 301 https://www.mysite.com$request_uri; however, that just goes into an endless loop Thanks
Try this: Code: server { listen *:80; server_name yourdomain.com; rewrite ^ https://$server_name$request_uri? permanent; } server { listen *:443 ssl; ssl_certificate /var/www/clients/clientnumber/webnumber/ssl/yourdomain.com.crt; ssl_certificate_key /var/www/clients/clientnumber/webnumber/ssl/yourdomain.com.key; ### the rest of your code }
Hi, The above method is almost how I'd like to achieve HTTPS over HTTP. According to NGINX, It's best practise for NGINX to use: Code: return 301 https://$host$request_uri; However, using this code or the above quoted method needs separate server blocks, correct? --Otherwise you will result with infinite loops. How does one achieve this with the sites within ISPConfig 3.0.5.3 using the directives field? Thank you.