I have this configuration:
- The Amazon Elastic Load Balancer (ELB) routes port 80 to port 81 and port 443 to port 80
- The cert is handled in ELB
- Nginx listens to port 80 and 81
- Port 81 redirects to https
- Port 80 is the main server
The nginx server block for port 81:
server { listen 81 default_server; listen [::]:81 default_server; server_name _; return 301 https://$host$request_uri; } The problem is that http requests timeout (408). Suggestions?
$http_x_forwarded_protoisn't set to the stringhttps, because ELB will set that for each request if the client connection uses HTTPS.