upstream nsupdate_server { server unix:/srv/nsupdate/run/gunicorn.sock fail_timeout=0; } server { listen :80; server_name www.nsupdate.info; return 301 http://nsupdate.info$request_uri; } server { listen :80; listen [::]:80; server_name nsupdate.info ipv4.nsupdate.info ipv6.nsupdate.info; access_log /srv/nsupdate/logs/nginx-access.log; error_log /srv/nsupdate/logs/nginx-error.log; root /srv/nsupdate/htdocs/; location / { try_files $uri @nsupdate; } location @nsupdate { proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header Host $http_host; proxy_redirect off; proxy_pass http://nsupdate_server; } error_page 500 502 503 504 /500.html; }