Better approach to redirect all zzls.xyz domains to nadeko.net

This commit is contained in:
sf.nadeko.net 2024-08-14 15:32:52 -04:00
parent b2008a51b0
commit 1007c68227
18 changed files with 31 additions and 268 deletions

5
.gitignore vendored
View file

@ -0,0 +1,5 @@
# Ignore everything
*
# But not NGINX
nginx

View file

@ -1,5 +0,0 @@
[librex]
type=http
host=127.0.0.1
port=10051
keys=inv.dat

View file

@ -1,5 +0,0 @@
[rimgo]
type=http
host=127.0.0.1
port=10050
keys=rimgo-real.dat

View file

@ -1,12 +0,0 @@
/var/log/nginx/*log {
daily
missingok
notifempty
maxage 1
create 640 http root
sharedscripts
compress
postrotate
test ! -r /run/nginx.pid || kill -USR1 `cat /run/nginx.pid`
endscript
}

View file

@ -1,9 +1,7 @@
limit_req_zone $binary_remote_addr zone=4get:10m rate=4r/s;
# CLEARNET
server {
error_log /var/log/nginx/4get.error.log;
server_name 4get.zzls.xyz 4get.nadeko.net 4getus.zzls.xyz 4getus.nadeko.net;
server_name 4get.nadeko.net;
include configs/general.conf;
include configs/robotsNone.conf;
include configs/security.conf;
@ -75,15 +73,7 @@ server {
server {
listen 80;
server_name 4get.zzls.xyz 4get.nadeko.net 4getus.zzls.xyz 4getus.nadeko.net;
server_name 4get.nadeko.net;
# If ([4get|4getus].zzls.xyz) domains are matched to $host, redirect them to the respective (.nadeko.net) domains.
# If not, redirect as normal.
map $host $domain {
default $host;
4get.zzls.xyz 4get.nadeko.net;
4getus.zzls.xyz 4getus.nadeko.net;
}
return 301 https://$domain$request_uri;
}
return 301 https://4get.nadeko.net$request_uri;
}

View file

@ -23,4 +23,4 @@ server {
server_name datamining.nadeko.net;
return 301 https://$host$request_uri;
}
}

View file

@ -22,7 +22,7 @@ server {
server {
listen 80;
server_name git.zzls.xyz git.nadeko.net;
server_name git.nadeko.net;
return 301 https://git.nadeko.net$request_uri;
}
}

View file

@ -1,6 +1,7 @@
# CLEARNET
server {
#error_log /var/log/nginx/inv.nadeko.net.error.log;
# Enabled due to Fail2Ban
error_log /var/log/nginx/inv.nadeko.net.error.log;
#access_log /var/log/nginx/inv.nadeko.net.access.log;
server_name inv.nadeko.net;
include configs/general.conf;
@ -40,7 +41,7 @@ server {
server {
listen 80;
server_name inv.zzls.xyz inv.nadeko.net;
server_name inv.nadeko.net;
return 301 https://inv.nadeko.net$request_uri;
}
}

View file

@ -1,8 +1,8 @@
server {
access_log /var/log/nginx/keygenmusic.zzls.xyz.access.log;
access_log /var/log/nginx/keygenmusic.access.log;
root /var/www/keygenmusic.tk-mirror;
index index.html;
server_name keygenmusic.zzls.xyz keygenmusic.nadeko.net;
server_name keygenmusic.nadeko.net;
include configs/general.conf;
include configs/security.conf;
@ -29,25 +29,9 @@ server {
http2 on;
}
server {
set $x "";
if ($host = keygenmusic.zzls.xyz) {
set $x 1;
}
if ($host = keygenmusic.nadeko.net) {
set $x 1;
}
if ($x = 1) {
return 301 https://$host$request_uri;
}
listen 80;
server_name keygenmusic.zzls.xyz keygenmusic.nadeko.net;
return 404;
}
server {
listen 80;
server_name keygenmusic.nadeko.net;
return 301 https://$host$request_uri;
}
}

View file

@ -33,7 +33,7 @@ server {
server {
listen 80;
server_name luna.zzls.xyz luna.nadeko.net;
server_name luna.nadeko.net;
return 301 https://luna.nadeko.net$request_uri;
}
}

View file

@ -21,7 +21,7 @@ server {
server {
#error_log /var/log/nginx/materialious.nadeko.net.error.log;
#access_log /var/log/nginx/materialious.nadeko.net.access.log;
#access_log /var/log/nginx/materialious.nadeko.net.access.log;
server_name syncious.nadeko.net;
include configs/general.conf;
include configs/robotsNone.conf;
@ -73,7 +73,7 @@ server {
server {
listen 80;
server_name materialious.nadeko.net syncious.nadeko.net;
server_name materialious.nadeko.net syncious.nadeko.net peerjs.nadeko.net;
return 301 https://$host$request_uri;
}
}

View file

@ -1,95 +0,0 @@
server {
server_name matrix.zzls.xyz;
include configs/general.conf;
include configs/robotsNone.conf;
include configs/security.conf;
location /.well-known/matrix/server {
return 200 '{ "m.server": "matrix.zzls.xyz:8448" }';
}
location /.well-known/matrix/client {
default_type application/json;
add_header Access-Control-Allow-Origin '*';
return 200 '{ "m.homeserver": { "base_url": "https://matrix.zzls.xyz" }, "org.matrix.msc3575.proxy": {"url": "https://matrix.zzls.xyz"}}';
}
#location ~ ^/(client/|_matrix/client/unstable/org.matrix.msc3575/sync) {
# proxy_pass http://127.0.0.1:40022;
# proxy_set_header X-Forwarded-For $remote_addr;
# proxy_set_header X-Forwarded-Proto $scheme;
# proxy_set_header Host $host;
#}
location ~ ^(/_matrix|/_synapse/client|/health|/_synapse/metrics) {
proxy_pass http://matrix;
include configs/proxy.conf;
client_max_body_size 64M;
}
# QUIC
include configs/http3.conf;
listen 443 ssl;
listen 8448 ssl;
listen 8448 quic;
http2 on;
}
server {
server_name matrix.nadeko.net;
include configs/general.conf;
include configs/robotsNone.conf;
include configs/security.conf;
location /.well-known/matrix/support {
return 200 '{"contacts": [{"matrix_id": "@fijxu:nadeko.net","email_address": "fijxu@nadeko.net","role": "m.role.admin"},{"email_address": "fijxu@nadeko.net","role": "m.role.security"}],"support_page": "https://nadeko.net/contact" }';
}
location /.well-known/matrix/server {
return 200 '{ "m.server": "matrix.nadeko.net:8448" }';
}
location /.well-known/matrix/client {
default_type application/json;
add_header Access-Control-Allow-Origin '*';
return 200 '{ "m.homeserver": { "base_url": "https://matrix.nadeko.net" }, "org.matrix.msc3575.proxy": {"url": "https://matrix.nadeko.net"}}';
}
location ~ ^/(client/|_matrix/client/unstable/org.matrix.msc3575/sync) {
proxy_pass http://127.0.0.1:10024;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Host $host;
}
location ~ ^(/_matrix|/_synapse/client|/health|/_synapse/metrics) {
proxy_pass http://matrix-nadeko;
include configs/proxy.conf;
client_max_body_size 64M;
}
location / {
proxy_pass http://127.0.0.1:10023;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Host $host;
client_max_body_size 64M;
proxy_http_version 1.1;
}
# QUIC
include configs/http3.conf;
listen 443 ssl reuseport;
listen 8448 ssl default_server reuseport;
listen 8448 quic default_server reuseport;
http2 on;
}
server {
listen 80;
server_name matrix.zzls.xyz matrix.nadeko.net;
return 301 https://matrix.nadeko.net$request_uri;
}

View file

@ -1,53 +0,0 @@
# CLEARNET
server {
server_name ri.zzls.xyz ri.nadeko.net;
include configs/general.conf;
include configs/robotsNone.conf;
location / {
proxy_pass http://rimgo;
include configs/proxy.conf;
}
# QUIC
include configs/http3.conf;
# TOR
add_header Onion-Location http://rimgo.nadekonw7plitnjuawu6ytjsl7jlglk2t6pyq6eftptmiv3dvqndwvyd.onion$request_uri;
listen 443 ssl;
http2 on;
}
# TOR
server {
listen 10040;
server_name rimgo.zzlsghu6mvvwyy75mvga6gaf4znbp3erk5xwfzedb4gg6qqh2j6rlvid.onion rimgo.nadekonw7plitnjuawu6ytjsl7jlglk2t6pyq6eftptmiv3dvqndwvyd.onion;
include configs/general.conf;
include configs/robotsNone.conf;
location / {
proxy_pass http://rimgo;
include configs/proxy.conf;
}
}
# I2P
server {
listen 30001;
server_name zzls3ubaix5wjfar4hskwqnh3vvwvrzoxsvcx64on2aogcxrvhoq.b32.i2p;
include configs/general.conf;
include configs/robotsNone.conf;
location / {
proxy_pass http://rimgo;
include configs/proxy.conf;
}
}
server {
listen 80;
server_name ri.zzls.xyz ri.nadeko.net;
return 301 https://ri.nadeko.net$request_uri;
}

View file

@ -0,0 +1,7 @@
# https://stackoverflow.com/a/39563133
server {
server_name ~^(?<name>\w+)\.zzls\.xyz$;
rewrite ^ https://$name.nadeko.net$request_uri? permanent;
listen 443 ssl;
listen 80;
}

View file

@ -1,6 +0,0 @@
# Rustlog
limit_req_zone $binary_remote_addr zone=rustlog-api-limit:1m rate=20r/s;
# Invidious
limit_req_zone $binary_remote_addr zone=invidious-apirl:4m rate=20r/s;
limit_req_zone $binary_remote_addr zone=invidious-front:10m rate=20r/s;

View file

@ -64,7 +64,6 @@ http {
include /etc/nginx/snippets/maps.conf;
include /etc/nginx/snippets/poop.conf;
#limit_conn_zone $binary_remote_addr zone=addr:10m;
include /etc/nginx/configs/upstreams.conf;
include /etc/nginx/configs/limits.conf;
include /etc/nginx/conf.d/*.conf;

View file

@ -1,19 +0,0 @@
[Unit]
Description=Matrix sliding sync proxy (MSC3575)
After=network-online.target
Wants=network-online.target
[Service]
Type=simple
User=root
Group=root
Environment=LANG=en_US.UTF-8
WorkingDirectory=/opt/sliding-sync
ExecStart=/opt/sliding-sync/syncv3
ExecReload=/usr/bin/kill -HUP $MAINPID
EnvironmentFile=/opt/sliding-sync/.env
Restart=always
RestartSec=3
[Install]
WantedBy=multi-user.target

View file

@ -1,28 +0,0 @@
[Unit]
Description=Minecraft Serber
After=network-online.target
Wants=network-online.target
[Service]
Type=forking
User=mc
Group=mc
Environment=JAVA_HOME=/usr/lib/jvm/java-8-openjdk
WorkingDirectory=/opt/mc/server/
ExecStart=/usr/bin/tmux new-session -s minecraft -d '/usr/lib/jvm/java-8-openjdk/bin/java -Xmx512M -Xms512M -jar project-poseidon-1.1.8.jar nogui'
ExecStop=/usr/bin/tmux send -t minecraft.0 stop ENTER
#ExecRestart=/usr/bin/tmux send -t minecraft.0 stop ENTER; sleep 10; /usr/bin/tmux new-session -s minecraft -d 'java -Xmx512M -Xms512M -jar project-poseidon-1.1.8.jar nogui'
TimeoutStopSec=10
TimeoutStartSec=10
StandardOutput=null
StandardError=null
RemainAfterExit=yes
KillMode=none
RestartMode=direct
#KillSignal=SIGINT
#RestartKillSignal=SIGINT
Restart=always
RestartSec=10
[Install]
WantedBy=multi-user.target