forked from exozyme/nginx
Anthony Wang
f9748b3ec7
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.
35 lines
797 B
Text
35 lines
797 B
Text
server {
|
|
listen 80 default_server;
|
|
listen [::]:80 default_server;
|
|
|
|
location / {
|
|
return 301 https://$host$request_uri;
|
|
}
|
|
}
|
|
|
|
server {
|
|
listen 443 ssl default_server;
|
|
listen [::]:443 ssl default_server;
|
|
server_name exozy.me;
|
|
|
|
root /srv/http/www;
|
|
index index.html;
|
|
|
|
location /.well-known/matrix/server {
|
|
return 200 '{"m.server": "chat.exozy.me:443"}';
|
|
}
|
|
|
|
location /.well-known/matrix/client {
|
|
return 200 '{"m.homeserver": {"base_url": "https://chat.exozy.me"}}';
|
|
default_type application/json;
|
|
add_header Access-Control-Allow-Origin *;
|
|
}
|
|
|
|
location /.well-known/webfinger {
|
|
return 301 https://social.exozy.me$request_uri;
|
|
}
|
|
|
|
location / {
|
|
try_files $uri $uri.html $uri/ =404;
|
|
}
|
|
}
|