From 0eef63e584da07e539c020c8e59596f4e2fa0f0e Mon Sep 17 00:00:00 2001 From: root Date: Mon, 21 Nov 2022 11:39:59 +0000 Subject: [PATCH] move website stuff to /en; mto subs_filter on new subdom; searxng darknet service subsfilter --- common/website.conf | 49 +++++++++++++++++++++++++++++++++++-------- conf.d/00website.conf | 7 +++++++ conf.d/bbs.conf | 4 ++-- conf.d/cinny.conf | 34 ++++++++++++++++++++++++++++++ conf.d/hydrogen.conf | 31 +++++++++++++++++++++++++++ conf.d/riot.conf | 34 ++++++++++++++++++++++++++++++ conf.d/searxng.conf | 23 ++++++++++++++++++++ 7 files changed, 171 insertions(+), 11 deletions(-) diff --git a/common/website.conf b/common/website.conf index db2564a..6c3296b 100644 --- a/common/website.conf +++ b/common/website.conf @@ -12,21 +12,52 @@ gzip_comp_level 6; gzip_buffers 16 8k; gzip_http_version 1.1; gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript; + +error_log /var/log/nginx/error.log; + +location /media { + alias /var/www/website/media; +} + +location /blog { + alias /var/www/website/blog; +} + +location /canaries { + alias /var/log/canary; +} + +location /gnuplot { + alias /opt/gnuplot; +} + +location /style.css { + alias /var/www/website/style.css; +} + +location /LICENSE.txt { + alias /var/www/website/LICENSE.txt; +} + location / { # rewrite ^(/.*)\.html(\?.*)?$ $1$2 permanent; # rewrite ^/(.*)/$ /$1 permanent; - try_files $uri $uri/index.html $uri.html $uri/ @extensionless-php; - +# try_files $uri $uri/index.html $uri.html $uri/ /en$uri @extensionless-php; + rewrite .* /$lang$uri; +} + +location /en { + try_files $uri $uri/index.html $uri.html $uri/ @extensionless-php; + error_page 403 /en/errors/403; + error_page 404 /en/errors/404; + error_page 503 /en/errors/503; } -error_page 403 /errors/403; -error_page 404 /errors/404; -error_page 503 /errors/503; location ~^/[^u~].*\.(jpg|jpeg|png|gif|ico)$ { expires 30d; } -location /errors/.* { +location /.*/errors/.* { internal; } @@ -108,9 +139,9 @@ location /sitemap { subs_filter "" ""; subs_filter "body,html {background:#fff;font-family:\"Bitstream Vera Sans\",\"Lucida Grande\",\"Lucida Sans Unicode\",Lucidux,Verdana,Lucida,sans-serif;}tr:nth-child(even) {background:#f4f4f4;}th,td {padding:0.1em 0.5em;}th {text-align:left;font-weight:bold;background:#eee;border-bottom:1px solid #aaa;}#list {border:1px solid #aaa;width:100%;}a {color:#a33;}a:hover {color:#e33;}" ""; subs_filter "/sitemap/" "/"; - error_page 403 /errors/403; - error_page 404 /errors/404; - error_page 503 /errors/503; + error_page 403 /en/errors/403; + error_page 404 /en/errors/404; + error_page 503 /en/errors/503; } location /status { vhost_traffic_status_display; diff --git a/conf.d/00website.conf b/conf.d/00website.conf index f78d7ad..239a248 100644 --- a/conf.d/00website.conf +++ b/conf.d/00website.conf @@ -1,3 +1,10 @@ +map $http_accept_language $lang { + default en; + ~en en; + ~es es; + ~fr fr; +} + server { listen 80; listen [::]:80; diff --git a/conf.d/bbs.conf b/conf.d/bbs.conf index d22f245..780e921 100644 --- a/conf.d/bbs.conf +++ b/conf.d/bbs.conf @@ -5,7 +5,7 @@ server { server_name vern5pgpfjdplnz7yhqazesx62hrx6r6i4xvv4kjshwefwikkjjuvwad.onion; subs_filter_types text/html text/css text/xml application/javascript text/plain; - subs_filter "ftelnet.vern.cc" "ftelnet.vernccvbvyi5qhfzyqengccj7lkove6bjot2xhh5kajhwvidqafczrad.onion"; + subs_filter "https://ftelnet.vern.cc" "http://ftelnet.vernccvbvyi5qhfzyqengccj7lkove6bjot2xhh5kajhwvidqafczrad.onion"; include common/bbs.conf; } @@ -17,7 +17,7 @@ server { server_name vernv5abwkzvlzneqto7x6vxw3bwdmd3emdnb4xuvwykwlghwaea.b32.i2p; subs_filter_types text/html text/css text/xml application/javascript text/plain; - subs_filter "ftelnet.vern.cc" "vernzscupwi6rmlkdivib3q54iqc6fa6bjwe2prxqt3x7mqv4ezq.b32.i2p"; + subs_filter "https://ftelnet.vern.cc" "http://vernzscupwi6rmlkdivib3q54iqc6fa6bjwe2prxqt3x7mqv4ezq.b32.i2p"; include common/bbs.conf; } diff --git a/conf.d/cinny.conf b/conf.d/cinny.conf index b00b76a..ba1de96 100644 --- a/conf.d/cinny.conf +++ b/conf.d/cinny.conf @@ -13,6 +13,8 @@ server { server_name vernyaourawd4avjf7ye6g43pqovys5wqdr672kervjpev353klq.b32.i2p; + subs_filter_types text/html text/css text/xml application/javascript text/plain; + subs_filter 'https://matrix.to' 'http://mto.vernccvbvyi5qhfzyqengccj7lkove6bjot2xhh5kajhwvidqafczrad.onion'; include common/cinny.conf; } @@ -31,3 +33,35 @@ server { return 301 https://$host$request_uri; } + + + +server { + listen 80; + listen [::]:80; + + server_name cnmto.vernccvbvyi5qhfzyqengccj7lkove6bjot2xhh5kajhwvidqafczrad.onion; + + subs_filter_types text/html text/css text/xml application/javascript text/plain; + subs_filter 'https://matrix.to' 'http://mto.vernccvbvyi5qhfzyqengccj7lkove6bjot2xhh5kajhwvidqafczrad.onion'; + include common/cinny.conf; +} + +server { + listen 443 ssl http2; + listen [::]:443 ssl http2; + server_name cnmto.vern.cc; + include snippets/lets-encrypt.conf; + + subs_filter_types text/html text/css text/xml application/javascript text/plain; + subs_filter 'matrix.to' 'mto.vern.cc'; + + include common/cinny.conf; +} + +server { + listen 80; + listen [::]:80; + server_name cnmto.vern.cc; + return 301 https://$host$request_uri; +} diff --git a/conf.d/hydrogen.conf b/conf.d/hydrogen.conf index 4332223..499c8c9 100644 --- a/conf.d/hydrogen.conf +++ b/conf.d/hydrogen.conf @@ -31,3 +31,34 @@ server { return 301 https://$host$request_uri; } + + +server { + listen 80; + listen [::]:80; + + server_name h2m2.vernccvbvyi5qhfzyqengccj7lkove6bjot2xhh5kajhwvidqafczrad.onion; + + subs_filter_types text/html text/css text/xml application/javascript text/plain; + subs_filter 'https://matrix.to' 'http://mto.vernccvbvyi5qhfzyqengccj7lkove6bjot2xhh5kajhwvidqafczrad.onion'; + include common/hydrogen.conf; +} + +server { + listen 443 ssl http2; + listen [::]:443 ssl http2; + server_name h2m2.vern.cc; + include snippets/lets-encrypt.conf; + + subs_filter_types text/html text/css text/xml application/javascript text/plain; + subs_filter 'matrix.to' 'mto.vern.cc'; + + include common/hydrogen.conf; +} + +server { + listen 80; + listen [::]:80; + server_name h2m2.vern.cc; + return 301 https://$host$request_uri; +} diff --git a/conf.d/riot.conf b/conf.d/riot.conf index 2a6e29b..89a8be7 100644 --- a/conf.d/riot.conf +++ b/conf.d/riot.conf @@ -13,6 +13,8 @@ server { server_name vernltmkmwexhk77dlxmqlet3djveje7gcq7lwy3l5gkemxysy5q.b32.i2p; + subs_filter_types text/html text/css text/xml application/javascript text/plain; + subs_filter 'https://matrix.to' 'http://mto.vernccvbvyi5qhfzyqengccj7lkove6bjot2xhh5kajhwvidqafczrad.onion'; include common/riot.conf; } @@ -21,6 +23,7 @@ server { listen [::]:443 ssl http2; server_name riot.vern.cc; include snippets/lets-encrypt.conf; + include common/riot.conf; } @@ -31,3 +34,34 @@ server { return 301 https://$host$request_uri; } + + +server { + listen 80; + listen [::]:80; + + server_name el.vernccvbvyi5qhfzyqengccj7lkove6bjot2xhh5kajhwvidqafczrad.onion; + + subs_filter_types text/html text/css text/xml application/javascript text/plain; + subs_filter 'https://matrix.to' 'http://mto.vernccvbvyi5qhfzyqengccj7lkove6bjot2xhh5kajhwvidqafczrad.onion'; + include common/riot.conf; +} + +server { + listen 443 ssl http2; + listen [::]:443 ssl http2; + server_name el.vern.cc; + include snippets/lets-encrypt.conf; + + subs_filter_types text/html text/css text/xml application/javascript text/plain; + subs_filter 'matrix.to' 'mto.vern.cc'; + + include common/riot.conf; +} + +server { + listen 80; + listen [::]:80; + server_name el.vern.cc; + return 301 https://$host$request_uri; +} diff --git a/conf.d/searxng.conf b/conf.d/searxng.conf index 6288fe1..4b4462f 100644 --- a/conf.d/searxng.conf +++ b/conf.d/searxng.conf @@ -4,6 +4,18 @@ server { server_name searx.vernccvbvyi5qhfzyqengccj7lkove6bjot2xhh5kajhwvidqafczrad.onion searxng.vernccvbvyi5qhfzyqengccj7lkove6bjot2xhh5kajhwvidqafczrad.onion search.vernccvbvyi5qhfzyqengccj7lkove6bjot2xhh5kajhwvidqafczrad.onion sx.vernccvbvyi5qhfzyqengccj7lkove6bjot2xhh5kajhwvidqafczrad.onion; + subs_filter https://inv.vern.cc http://inv.vernccvbvyi5qhfzyqengccj7lkove6bjot2xhh5kajhwvidqafczrad.onion; + subs_filter https://lr.vern.cc http://lr.vernccvbvyi5qhfzyqengccj7lkove6bjot2xhh5kajhwvidqafczrad.onion; + subs_filter https://nt.vern.cc http://nt.vernccvbvyi5qhfzyqengccj7lkove6bjot2xhh5kajhwvidqafczrad.onion; + subs_filter https://tt.vern.cc http://tt.vernccvbvyi5qhfzyqengccj7lkove6bjot2xhh5kajhwvidqafczrad.onion; + subs_filter https://wl.vern.cc http://wl.vernccvbvyi5qhfzyqengccj7lkove6bjot2xhh5kajhwvidqafczrad.onion; + subs_filter https://ld.vern.cc http://ld.vernccvbvyi5qhfzyqengccj7lkove6bjot2xhh5kajhwvidqafczrad.onion; + subs_filter https://lbry.vern.cc http://lbry.vernccvbvyi5qhfzyqengccj7lkove6bjot2xhh5kajhwvidqafczrad.onion; + subs_filter https://sc.vern.cc http://sc.vernccvbvyi5qhfzyqengccj7lkove6bjot2xhh5kajhwvidqafczrad.onion; + subs_filter https://tl.vern.cc http://tl.vernccvbvyi5qhfzyqengccj7lkove6bjot2xhh5kajhwvidqafczrad.onion; + subs_filter https://qr.vern.cc http://qr.vernccvbvyi5qhfzyqengccj7lkove6bjot2xhh5kajhwvidqafczrad.onion; + + include common/searxng.conf; } @@ -13,6 +25,17 @@ server { server_name vernvtyi6rdcmv646in4qb4qkbtdi32f4m7zbkcoyualz7bzsfrq.b32.i2p; + subs_filter https://inv.vern.cc http://verni6dr4qxjgjumnvesxerh5rvhv6oy5ddeibaqy5d7tgbiiyfa.b32.i2p; + subs_filter https://lr.vern.cc http://vernchoyi4qjf6sz5vi57sskoelw5lsf53u62i5uvktzpa6sxv3a.b32.i2p; + subs_filter https://nt.vern.cc http://vernzdedoxuflrrxc4vbatbkpjh4k22ecgiqgimdiif62onhagva.b32.i2p; + subs_filter https://tt.vern.cc http://vern2gwxbtxzhb3rgchv4kbhlqppijhjqg7rmgvp4c5bxihxcm3a.b32.i2p; + subs_filter https://wl.vern.cc http://vernesciy2defjsputrjrv6pa5ll6qzrckfffi5lgkumstdojyga.b32.i2p; + subs_filter https://ld.vern.cc http://vernz3ubrntql4wrgyrssd6u3qzi36zrhz2agbo6vibzbs5olk2q.b32.i2p; + subs_filter https://lbry.vern.cc http://vernb4mvgeej5kawfg3tm337sbihdf4i6oy7w4trirgsnaq67zva.b32.i2p; + subs_filter https://sc.vern.cc http://vern3whzyfmjclq6snhlupma6nrmojghwp37tydfgqotj7sc6izq.b32.i2p; + subs_filter https://tl.vern.cc http://verna7avzgd4qqal7k2onjzwxcceqby2gwvya2a2frdswb7z2k4q.b32.i2p; + subs_filter https://qr.vern.cc http://vernnflenvsqccuanaun7yydnmturi4jkyxlyzhn6ultpje66c3q.b32.i2p; + include common/searxng.conf; }