Skip to content

Instantly share code, notes, and snippets.

@echicken
Created May 21, 2024 17:12
Show Gist options
  • Save echicken/1458e692913f0b549f215a7cc78c3785 to your computer and use it in GitHub Desktop.
Save echicken/1458e692913f0b549f215a7cc78c3785 to your computer and use it in GitHub Desktop.
ecbbs nginx
upstream ecbbs {
server 192.168.2.18:8080;
}
upstream ecbbs_ws {
server 192.168.2.18:1123;
}
server {
listen 80;
listen [::]:80;
server_name bbs.electronicchicken.com;
server_tokens off;
location /.well-known/acme-challenge/ {
root /var/www/certbot;
}
location / {
return 301 https://bbs.electronicchicken.com$request_uri;
}
}
server {
listen 443 default_server ssl;
listen [::]:443 ssl;
server_name bbs.electronicchicken.com;
ssl_certificate /etc/letsencrypt/live/bbs.electronicchicken.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/bbs.electronicchicken.com/privkey.pem;
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_pass http://ecbbs;
}
}
server {
listen 1124 ssl;
listen [::]:1124 ssl;
server_name bbs.electronicchicken.com;
ssl_certificate /etc/letsencrypt/live/bbs.electronicchicken.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/bbs.electronicchicken.com/privkey.pem;
location / {
proxy_http_version 1.1;
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 Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_pass http://ecbbs_ws;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment