Nginx and Go through unix socket

Simple setup example Our nginx vhost: upstream ango { server unix:/tmp/ango.sock; } # the nginx server instance server { listen 80; server_name go.dev *.go.dev; error_log /var/log/nginx/go_error.log; location / { proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $http_host; proxy_set_header X-NginX-Proxy true; proxy_http_version 1.1; # for keep-alive proxy_pass http://ango/; proxy_redirect off; } } The Go app […]