Skip to content

Instantly share code, notes, and snippets.

@wwj718
Created July 7, 2020 04:01
Show Gist options
  • Save wwj718/b94aee93b8524e5bc2f0cc433acaf8b9 to your computer and use it in GitHub Desktop.
Save wwj718/b94aee93b8524e5bc2f0cc433acaf8b9 to your computer and use it in GitHub Desktop.
server {
listen 80; listen [::]:80;
server_name forums.codelab.club; # <-- change this
return 301 https://$host$request_uri;
}
server {
listen 443 ssl http2; listen [::]:443 ssl http2;
server_name forums.codelab.club; # <-- change this
ssl on;
ssl_certificate /home/wwj/.acme.sh/codelab.club/fullchain.cer;
ssl_certificate_key /home/wwj/.acme.sh/codelab.club/codelab.club.key;
ssl_trusted_certificate /home/wwj/.acme.sh/codelab.club/ca.cer;
http2_idle_timeout 5m; # up from 3m default
location / {
proxy_pass http://unix:/var/discourse/shared/standalone/nginx.http.sock:;
proxy_set_header Host $http_host;
proxy_http_version 1.1;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
proxy_set_header X-Real-IP $remote_addr;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment