Skip to content

Instantly share code, notes, and snippets.

@rickheil
Last active August 29, 2021 11:43
Show Gist options
  • Save rickheil/a36a2cd8ebe326b304c3 to your computer and use it in GitHub Desktop.
Save rickheil/a36a2cd8ebe326b304c3 to your computer and use it in GitHub Desktop.
nginx configuration for graylog reverse proxy, HTTPS forced
server {
listen 80;
return 301 https://$host$request_uri;
}
server {
listen 443;
server_name graylog.example.com;
ssl_certificate /etc/nginx/path-to-your-cert.crt;
ssl_certificate_key /etc/nginx/path-to-your-key.key;
ssl on;
ssl_session_cache builtin:1000 shared:SSL:10m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers HIGH:!aNULL:!eNULL:!EXPORT:!CAMELLIA:!DES:!MD5:!PSK:!RC4;
ssl_prefer_server_ciphers on;
access_log /var/log/nginx/graylog.access.log;
location / {
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-Proto $scheme;
proxy_pass http://localhost:9000;
proxy_read_timeout 90;
proxy_redirect http://localhost:9090 https://graylog.example.com;
}
}
@zerjioang
Copy link

Is this line ok?
proxy_redirect http://localhost:9090
should'nt be 9000?

@bgadmin
Copy link

bgadmin commented Apr 20, 2017

Is this working?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment