nginx-configs/conf.d/00website.conf

210 lines
6.8 KiB
Plaintext

server {
listen 80;
listen [::]:80;
server_name verncceu2kgz54wi7r5jatgmx2mqtsh3knxhiy4m5shescuqtqfa.b32.i2p;
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": "http://verndnomc4cnte4aw7yrfpse33vrw2nlwoxozxmf77zqquk6ea7q.b32.i2p"}}';
}
location /_matrix {
return 301 http://verndnomc4cnte4aw7yrfpse33vrw2nlwoxozxmf77zqquk6ea7q.b32.i2p$request_uri;
}
# subs_filter "wiki.vern.cc" "vernknid6kpyzaghegtnypzxe2nx643zrfc4jivh2tlna5m5jvcq.b32.i2p"
include common/website.conf;
location ~ ^/socks/(?<user>[\w-]+)/(?<site>[\w-]+)(?<user_uri>/.*)?$ {
add_header Onion-Location http://$site-$user.vernccvbvyi5qhfzyqengccj7lkove6bjot2xhh5kajhwvidqafczrad.onion$request_uri;
add_header X-I2P-Location http://verncceu2kgz54wi7r5jatgmx2mqtsh3knxhiy4m5shescuqtqfa.b32.i2p/socks/$site/$user$user_uri;
error_log /var/log/nginx/vern.cc-error.log info;
proxy_pass http://unix:/var/socks/$user.sock:/;
proxy_http_version 1.1;
proxy_set_header Host $site-$user.vern.cc;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
subs_filter_types text/html text/css text/xml application/javascript text/plain;
subs_filter (((file|virtual|src|href)=|url\()["']?)/([^/]) $1/socks/$user/$site/$4 r;
error_page 502 =307 http://verncceu2kgz54wi7r5jatgmx2mqtsh3knxhiy4m5shescuqtqfa.b32.i2p;
}
}
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;
server_name vernccvbvyi5qhfzyqengccj7lkove6bjot2xhh5kajhwvidqafczrad.onion www.vernccvbvyi5qhfzyqengccj7lkove6bjot2xhh5kajhwvidqafczrad.onion;
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"}}';
}
location /_matrix {
return 301 http://mtrx.vernccvbvyi5qhfzyqengccj7lkove6bjot2xhh5kajhwvidqafczrad.onion$request_uri;
}
subs_filter "wiki.vern.cc" "wiki.vernccvbvyi5qhfzyqengccj7lkove6bjot2xhh5kajhwvidqafczrad.onion";
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 "wiki.vern.cc" "wiki.vernccvbvyi5qhfzyqengccj7lkove6bjot2xhh5kajhwvidqafczrad.onion";
include common/website.conf;
}
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name www.vern.cc vern.cc;
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.vern.cc:443"}';
}
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" }}';
}
location /.well-known/host-meta {
default_type 'application/xrd+xml';
add_header Access-Control-Allow-Origin '*' always;
return 200 '<?xml version="1.0" encoding="UTF-8"?><XRD xmlns=\'http://docs.oasis-open.org/ns/xri/xrd-1.0\'><Link href=\'https://vern.cc:5281/http-bind\' rel=\'urn:xmpp:alt-connections:xbosh\'/><Link href=\'wss://vern.cc:5281/xmpp-websocket\' rel=\'urn:xmpp:alt-connections:websocket\'/></XRD>';
}
location /.well-known/host-meta.json {
default_type 'application/jrd+json';
add_header Access-Control-Allow-Origin '*' always;
return 200 '{"links":[{"rel":"urn:xmpp:alt-connections:xbosh","href":"https://vern.cc:5281/http-bind"},{"rel":"urn:xmpp:alt-connections:websocket","href":"wss://vern.cc:5281/xmpp-websocket"}]}';
}
include common/website.conf;
}
server {
listen 80;
listen [::]:80;
return 301 https://$host$request_uri;
server_name www.vern.cc vern.cc;
}
server {
listen 80;
listen [::]:80;
listen 443 ssl http2;
listen [::]:443 ssl http2;
include snippets/lets-encrypt.conf;
server_name stupid.vern.cc;
return 301 https://aryak.vern.cc$request_uri;
}
server {
listen 80;
listen [::]:80;
listen 443 ssl http2;
listen [::]:443 ssl http2;
include snippets/lets-encrypt.conf;
server_name blog.vern.cc;
return 301 https://vern.cc/blog$request_uri;
}
server {
server_name blog.vernccvbvyi5qhfzyqengccj7lkove6bjot2xhh5kajhwvidqafczrad.onion;
listen 80;
listen [::]:80;
return 301 http://vernccvbvyi5qhfzyqengccj7lkove6bjot2xhh5kajhwvidqafczrad.onion/blog$request_uri;
add_header Onion-Location http://blog.vernccvbvyi5qhfzyqengccj7lkove6bjot2xhh5kajhwvidqafczrad.onion$request_uri;
}
server {
server_name myip.vern.cc;
listen 443 ssl http2;
listen [::]:443 ssl http2;
include snippets/lets-encrypt.conf;
return 200 127.0.0.1;
}
server {
server_name myip.vern.cc;
listen 80;
listen [::]:80;
return 200 127.0.0.1;
}
server {
server_name myip.vernccvbvyi5qhfzyqengccj7lkove6bjot2xhh5kajhwvidqafczrad.onion;
listen 80;
listen [::]:80;
return 200 127.0.0.1;
}
server {
server_name vernamluei326jvvjdrdcsi5hcbgiig7anytm3xe3c6lj5jvgmba.b32.i2p;
listen 11064;
listen [::]:11064;
return 200 127.0.0.1;
}