redirect - Ispconfig nginx redirecting to https -
i've deployed centos server ispconfig , nginx.
also able configure nginx, manually (by editing /etc/nginx/sites-available/mysite.com.vhost), redirect http requests https:
server { listen 80; server_name mysite.com; return 301 https://$server_name$request_uri; } server { listen 443 ssl; .. }
as edited file manually, every time change setting ispconfig, vhost file gets overwritten , lose redirection's trick.
do know way config redirection above using ispconfig panel instead editing nginx file manually ?
thanks in avance.
on more recent versions of ispconfig, can select website use ssl (and means https, , optionally, spdy or http/2), additional checkbox redirect http requests permanently https, , ispconfig automatically generate vhosts files correctly.
for sake of completude, ispconfig adds:
server { listen *:80; listen *:443 ssl; ssl_protocols tlsv1 tlsv1.1 tlsv1.2; ssl_certificate /var/www/clients/clientx/weby/ssl/your.web.site.crt; ssl_certificate_key /var/www/clients/clientx/weby/ssl/your.web.site.key; server_name your.web.site www.your.web.site; root /var/www/your.web.site/web/; if ($http_host = "www.your.web.site") { rewrite ^ $scheme://your.web.site$request_uri? permanent; } if ($scheme != "https") { rewrite ^ https://$http_host$request_uri? permanent; } index index.html index.htm index.php index.cgi index.pl index.xhtml;
Comments
Post a Comment