Nginx redirect loop when force SSL
up vote
0
down vote
favorite
This has been asked before but none of the accepted answers I've found worked for me. I'm using this general rule to route all http-traffic to https: # Redirect http # ========================================================================== server { listen 80 default_server; listen [::]:80 default_server; server_name www.example.com example.com; return 301 https://www.example.com$request_uri; } # Redirect non-www / https # ========================================================================== server { # ports listen 443 ssl http2; listen [::]:443 ssl http2; # domain name server_name example.com; # ssl certificate files ssl_certificate /etc/ssl/certs/*****.crt; ssl_certificate_key /etc/ssl/private/*****.key; #...