Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
updated nginx config
# setup a upstream point to CodiMD server
upstream @codimd {
server 127.0.0.1:3000;
keepalive 300;
}
# for socket.io (http upgrade)
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
server {
listen 80;
listen [::]:80;
server_name pad.noisebridge.info;
return 302 https://pad.noisebridge.info$request_uri;
}
server {
server_name pad.noisebridge.info;
#listen [::]:443 ssl ipv6only=on; # managed by Certbot
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/noisebridge.info/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/noisebridge.info/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
location / {
proxy_http_version 1.1;
# set header for proxy protocol
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_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
# setup for image upload
client_max_body_size 8192m;
proxy_max_temp_file_size 8192m;
proxy_read_timeout 300;
proxy_connect_timeout 300;
proxy_pass http://@codimd;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.