Skip to content

Instantly share code, notes, and snippets.

@strycore
Created April 11, 2017 03:07
Show Gist options
  • Save strycore/01a6d03bd282195554beec630668486c to your computer and use it in GitHub Desktop.
Save strycore/01a6d03bd282195554beec630668486c to your computer and use it in GitHub Desktop.
Discourse example config
upstream discourse {
server 172.17.0.1:81;
}
server {
listen 62.210.136.153:80;
listen [::]:80;
server_name forums.lutris.net;
return 301 https://$host$request_uri;
}
server {
listen 62.210.136.153:443 ssl http2;
listen [::]:443 ssl;
server_name forums.lutris.net;
access_log /var/log/nginx/discourse.access.log;
error_log /var/log/nginx/discourse.error.log;
ssl_certificate /etc/letsencrypt/live/forums.lutris.net/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/forums.lutris.net/privkey.pem;
ssl_session_timeout 5m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv3:+EXP;
ssl_prefer_server_ciphers on;
location / {
proxy_pass http://discourse;
proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
proxy_redirect off;
proxy_buffering off;
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 https;
proxy_http_version 1.1;
}
location /.well-known {
root /home/strider/certs;
autoindex on;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment