Nginx proxy pass works for https but not http

view story

http://serverfault.com – I want to redirect HTTP traffic and HTTPS traffic to a backend Flask application amd I have the snippet below in my nginx.conf which works for https but not for http server { listen 80; listen 443 ssl; ssl_certificate /usr/local/nginx/server.crt; ssl_certificate_key /usr/local/nginx/server.key; location / { proxy_redirect off; proxy_cache off; proxy_pass; proxy_set_header Host $http_host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; (HowTos)