nginx/xtex.conf
Anthony Wang f9748b3ec7
Change /srv/http/pages to /srv/http, don't automatically forward ports 4200-9
The first change doesn't require any manual intervention since /srv/http/pages is now symlinked to /srv/http. The purpose of it is just to make paths shorter, that's all.

I have several reasons for the second change, even though it may have been a useful feature:
- Security: Some programs use those ports by default and you don't want to accidentally expose them to the internet. If you want to run a program on exozyme and view it on your own computer, use SSH port forwarding instead.
- There was some weird DNS resolution problem with that config so I made it only listen to IPv4, which can cause problems since some programs only bind to IPv6.
- If you want to expose a program to the internet, you must use a Unix socket or socat. This feature was useful as a quick-and-dirty option, but socat is also just one command and doesn't require much more effort.
2024-01-20 16:01:08 +00:00

43 lines
1.2 KiB
Text

server {
listen 443 ssl;
listen [::]:443 ssl;
server_name xtexx.eu.org;
ssl_certificate /etc/letsencrypt/live/xtexx.eu.org/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/xtexx.eu.org/privkey.pem;
add_header Server exozyme;
location / {
proxy_pass http://unix:/srv/http/xtexhome;
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 WebSockets
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
}
}
server {
listen 443 ssl;
listen [::]:443 ssl;
server_name blog.xtexx.eu.org;
ssl_certificate /etc/letsencrypt/live/xtexx.eu.org/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/xtexx.eu.org/privkey.pem;
add_header Server exozyme;
location / {
proxy_pass http://unix:/srv/http/xtexblog;
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;
}
}