server { listen 80; listen [::]:80; server_name logs.mydomain.com; return 301 https://$server_name$request_uri; } server { listen 443 ssl http2; listen [::]:443 ssl http2; server_name logs.mydomain.com; large_client_header_buffers 4 16k; location / { proxy_set_header Host $http_host; proxy_set_header X-Forwarded-Host $host; proxy_set_header X-Forwarded-Server $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Graylog-Server-URL https://logs.mydomain.com/api; proxy_pass http://127.0.0.1:9000; } error_page 502 /502.html; location /502.html { root /srv/http/localhost; } }