diff --git a/common/matrixstatic.conf b/common/matrix-static.conf similarity index 100% rename from common/matrixstatic.conf rename to common/matrix-static.conf diff --git a/common/matrix-sydent.conf b/common/matrix-sydent.conf new file mode 100644 index 0000000..cfcb9c7 --- /dev/null +++ b/common/matrix-sydent.conf @@ -0,0 +1,10 @@ +add_header Onion-Location http://id.vernccvbvyi5qhfzyqengccj7lkove6bjot2xhh5kajhwvidqafczrad.onion$request_uri; +add_header X-I2P-Location http://vern4l4bo3tzed7niopxkfijgbyod6vc7pmqrhice2mjvjfboqua.b32.i2p$request_uri; + +location / { + proxy_pass http://iceberg.vern.cc/; + proxy_redirect off; + proxy_set_header Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; +} diff --git a/common/tmate.conf b/common/tmate.conf new file mode 100644 index 0000000..a5395b6 --- /dev/null +++ b/common/tmate.conf @@ -0,0 +1,8 @@ +location / { + proxy_pass http://localhost:4001/; + proxy_redirect off; + proxy_set_header Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_cookie_path / "/; Secure; HttpOnly; SameSite=lax"; +} diff --git a/common/website.conf b/common/website.conf index cbdfd0b..a910b59 100644 --- a/common/website.conf +++ b/common/website.conf @@ -39,6 +39,15 @@ location /LICENSE.txt { alias /var/www/website/LICENSE.txt; } +location /tmate.conf { + alias /var/www/website/tmate.conf; + default_type text/plain; +} +location /.tmate.conf { + default_type text/plain; + alias /var/www/website/tmate.conf; +} + location / { if ( -d /var/www/website/$lang) { rewrite .* /$lang$uri; diff --git a/conf.d/00website.conf b/conf.d/00website.conf index 89f3e67..d2ba07a 100644 --- a/conf.d/00website.conf +++ b/conf.d/00website.conf @@ -21,7 +21,7 @@ server { location /.well-known/matrix/client { default_type application/json; add_header Access-Control-Allow-Origin *; - return 200 '{"m.homeserver": {"base_url": "http://verndnomc4cnte4aw7yrfpse33vrw2nlwoxozxmf77zqquk6ea7q.b32.i2p"}}'; + return 200 '{"m.homeserver": {"base_url": "http://verndnomc4cnte4aw7yrfpse33vrw2nlwoxozxmf77zqquk6ea7q.b32.i2p"}, "m.identity_server": { "base_url": "http://vern4l4bo3tzed7niopxkfijgbyod6vc7pmqrhice2mjvjfboqua.b32.i2p" }}'; } location /_matrix { @@ -52,28 +52,6 @@ server { } } -server { - listen 443 ssl http2; - listen [::]:443 ssl http2; - - server_name verncceu2kgz54wi7r5jatgmx2mqtsh3knxhiy4m5shescuqtqfa.b32.i2p; - include snippets/lets-encrypt.conf; - - location /.well-known/matrix/server { - default_type application/json; - add_header Access-Control-Allow-Origin *; - return 200 '{"m.server": "verndnomc4cnte4aw7yrfpse33vrw2nlwoxozxmf77zqquk6ea7q.b32.i2p:80"}'; - } - - location /.well-known/matrix/client { - default_type application/json; - add_header Access-Control-Allow-Origin *; - return 200 '{"m.homeserver": {"base_url": "https://verndnomc4cnte4aw7yrfpse33vrw2nlwoxozxmf77zqquk6ea7q.b32.i2p"}}'; - } -# subs_filter "wiki.vern.cc" "vernknid6kpyzaghegtnypzxe2nx643zrfc4jivh2tlna5m5jvcq.b32.i2p" - include common/website.conf; -} - server { listen 80; listen [::]:80; @@ -89,7 +67,7 @@ server { location /.well-known/matrix/client { default_type application/json; add_header Access-Control-Allow-Origin *; - return 200 '{"m.homeserver": {"base_url": "http://mtrx.vernccvbvyi5qhfzyqengccj7lkove6bjot2xhh5kajhwvidqafczrad.onion"}}'; + return 200 '{"m.homeserver": {"base_url": "http://mtrx.vernccvbvyi5qhfzyqengccj7lkove6bjot2xhh5kajhwvidqafczrad.onion"}, "m.identity_server": { "base_url": "http://id.vernccvbvyi5qhfzyqengccj7lkove6bjot2xhh5kajhwvidqafczrad.onion" }}'; } location /_matrix { @@ -101,31 +79,6 @@ server { include common/website.conf; } -server { - listen 443 ssl http2; - listen [::]:443 ssl http2; - - server_name vernccvbvyi5qhfzyqengccj7lkove6bjot2xhh5kajhwvidqafczrad.onion www.vernccvbvyi5qhfzyqengccj7lkove6bjot2xhh5kajhwvidqafczrad.onion; - include snippets/lets-encrypt.conf; - - - location /.well-known/matrix/server { - default_type application/json; - add_header Access-Control-Allow-Origin *; - return 200 '{"m.server": "mtrx.vernccvbvyi5qhfzyqengccj7lkove6bjot2xhh5kajhwvidqafczrad.onion:80"}'; - } - - location /.well-known/matrix/client { - default_type application/json; - add_header Access-Control-Allow-Origin *; - return 200 '{"m.homeserver": {"base_url": "http://mtrx.vernccvbvyi5qhfzyqengccj7lkove6bjot2xhh5kajhwvidqafczrad.onion"}}'; - } - subs_filter_types text/html text/css text/xml application/javascript text/plain; - subs_filter "wiki.vern.cc" "wiki.vernccvbvyi5qhfzyqengccj7lkove6bjot2xhh5kajhwvidqafczrad.onion"; - - include common/website.conf; -} - server { listen 443 ssl http2; listen [::]:443 ssl http2; @@ -142,7 +95,7 @@ server { location /.well-known/matrix/client { default_type application/json; add_header Access-Control-Allow-Origin *; - return 200 '{"m.homeserver": {"base_url": "https://mtrx.vern.cc"}, "m.identity_server": { "base_url": "https://vector.im" }}'; + return 200 '{"m.homeserver": {"base_url": "https://mtrx.vern.cc"}, "m.identity_server": { "base_url": "https://id.vern.cc" }}'; } location /.well-known/host-meta { default_type 'application/xrd+xml'; diff --git a/conf.d/matrixstatic.conf b/conf.d/matrix-static.conf similarity index 81% rename from conf.d/matrixstatic.conf rename to conf.d/matrix-static.conf index ddbdc0a..d81b4b3 100644 --- a/conf.d/matrixstatic.conf +++ b/conf.d/matrix-static.conf @@ -4,7 +4,7 @@ server { server_name mvw.vernccvbvyi5qhfzyqengccj7lkove6bjot2xhh5kajhwvidqafczrad.onion; - include common/matrixstatic.conf; + include common/matrix-static.conf; } server { @@ -13,7 +13,7 @@ server { server_name vernwbp4lxrl7vn5jjgmrdkxnncpfwdzyv57jya2enmw76y4vdha.b32.i2p; - include common/matrixstatic.conf; + include common/matrix-static.conf; } server { @@ -21,7 +21,7 @@ server { listen [::]:443 ssl http2; server_name mvw.vern.cc; include snippets/lets-encrypt.conf; - include common/matrixstatic.conf; + include common/matrix-static.conf; } server { diff --git a/conf.d/matrix-sydent.conf b/conf.d/matrix-sydent.conf new file mode 100644 index 0000000..ae11683 --- /dev/null +++ b/conf.d/matrix-sydent.conf @@ -0,0 +1,32 @@ +server { + listen 80; + listen [::]:80; + + server_name id.vernccvbvyi5qhfzyqengccj7lkove6bjot2xhh5kajhwvidqafczrad.onion; + + include common/matrix-sydent.conf; +} + +server { + listen 11085; + listen [::]:11085; + + server_name vern4l4bo3tzed7niopxkfijgbyod6vc7pmqrhice2mjvjfboqua.b32.i2p; + + include common/matrix-sydent.conf; +} + +server { + listen 443 ssl http2; + listen [::]:443 ssl http2; + server_name id.vern.cc; + include snippets/lets-encrypt.conf; + include common/matrix-sydent.conf; +} + +server { + listen 80; + listen [::]:80; + return 301 https://$host$request_uri; + server_name id.vern.cc; +} diff --git a/conf.d/tmate.conf b/conf.d/tmate.conf new file mode 100644 index 0000000..10a79f9 --- /dev/null +++ b/conf.d/tmate.conf @@ -0,0 +1,14 @@ +server { + listen 443 ssl http2; + listen [::]:443 ssl http2; + server_name tm.vern.cc; + include common/tmate.conf; + include snippets/lets-encrypt.conf; +} + +server { + listen 80; + listen [::]:80; + return 301 https://$host$request_uri; + server_name tm.vern.cc; +}