The following Nginx configuration will reverse-proxy a graylog2 instance listening on the default address and port.
server { listen 80; server_name webserver.tld; location /graylog/ { proxy_pass http://127.0.0.1:9000; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Host $host; proxy_set_header X-Forwarded-Server $host; proxy_set_header X-Graylog-Server-URL http://$server_name/graylog/; rewrite ^/graylog/(.*)$ /$1 break; } }
where:
webserver.tld
is the webserver hostname