This commit is contained in:
2023-08-04 23:43:57 +02:00
parent e2bf7bca71
commit d139b218b9
12 changed files with 219 additions and 21 deletions

View File

@ -0,0 +1,75 @@
upstream php {
server unix:/var/run/php/php7.4-fpm.sock;
}
server {
listen 80;
listen 443 ssl;
server_name bbs.spacc.eu.org;
ssl_certificate /etc/letsencrypt/live/bbs.spacc.eu.org/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/bbs.spacc.eu.org/privkey.pem;
ssl_prefer_server_ciphers on;
root /Server/www/SpaccBBS;
index index.php index.html index.htm;
# Loggers
error_log /var/log/nginx/SpaccBBS.error.log warn;
access_log /var/log/nginx/SpaccBBS.access.log;
location / {
try_files $uri $uri/ @rewriteapp;
# Pass the php scripts to FastCGI server specified in upstream declaration.
location ~ \.php(/|$) {
include fastcgi.conf;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
fastcgi_param DOCUMENT_ROOT $realpath_root;
try_files $uri $uri/ /app.php$is_args$args;
fastcgi_pass php;
}
# Deny access to internal phpbb files.
location ~ /(config\.php|common\.php|cache|files|images/avatars/upload|install.bak|(?<!ext/)phpbb(?!\w+)|store|vendor) {
deny all;
# deny was ignored before 0.8.40 for connections over IPv6.
# Use internal directive to prohibit access on older versions.
internal;
}
location /includes {
deny all;
internal;
}
}
location @rewriteapp {
rewrite ^(.*)$ /app.php/$1 last;
}
# Correctly pass scripts for installer
location /install/ {
try_files $uri $uri/ @rewrite_installapp =404;
# Pass the php scripts to fastcgi server specified in upstream declaration.
location ~ \.php(/|$) {
include fastcgi.conf;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
fastcgi_param DOCUMENT_ROOT $realpath_root;
try_files $uri $uri/ /install/app.php$is_args$args =404;
fastcgi_pass php;
}
}
location @rewrite_installapp {
rewrite ^(.*)$ /install/app.php/$1 last;
}
# Deny access to version control system directories.
location ~ /\.svn|/\.git {
deny all;
internal;
}
}

View File

@ -0,0 +1,62 @@
server {
listen 443 ssl;
server_name x.spacc.eu.org;
ssl_certificate /etc/letsencrypt/live/x.spacc.eu.org/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/x.spacc.eu.org/privkey.pem;
ssl_prefer_server_ciphers on;
location / {
root /Server/www/XSpacc;
if ($request_uri ~ ^([^.\?]*[^/])$) {
return 301 $1/;
}
try_files $uri $uri/ $uri.html;
autoindex off;
}
}
server {
listen 443 ssl;
server_name graph.x.spacc.eu.org;
ssl_certificate /etc/letsencrypt/live/graph.x.spacc.eu.org/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/graph.x.spacc.eu.org/privkey.pem;
ssl_prefer_server_ciphers on;
location / {
proxy_http_version 1.1;
proxy_pass https://149.154.164.13:443;
proxy_set_header Host telegra.ph;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Accept-Encoding ''; # Needed for sub_filter
sub_filter '<body>' '<body><link rel="stylesheet" href="//x.spacc.eu.org/x.css"/><p class="x-spacc">Content Proxied from <a href="//x.spacc.eu.org">X by Spacc Inc.</a> — <a href="//telegra.ph$request_uri">Upstream</a></p>';
sub_filter_once off;
}
}
server {
listen 443 ssl;
server_name reddit.x.spacc.eu.org;
ssl_certificate /etc/letsencrypt/live/reddit.x.spacc.eu.org/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/reddit.x.spacc.eu.org/privkey.pem;
ssl_prefer_server_ciphers on;
location / {
proxy_http_version 1.1;
proxy_pass https://old.reddit.com;
proxy_set_header Host old.reddit.com;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Accept-Encoding ''; # Needed for sub_filter
sub_filter '</head>' '<meta name="viewport" content="width=device-width, initial-scale=1.0"/></head>';
sub_filter '<body ' '<body><link rel="stylesheet" href="//x.spacc.eu.org/reddit.css"/><p class="x-spacc">Content Proxied from <a href="//x.spacc.eu.org">X by Spacc Inc.</a> — <a href="//old.reddit.com$request_uri">Upstream</a></p><meta ';
sub_filter '<a href="https://old.reddit.com/' '<a href="/';
sub_filter '<script>' '<delscript>';
sub_filter '<script ' '<delscript ';
sub_filter '</script>' '</delscript>';
sub_filter_once off;
}
}

View File

@ -6,7 +6,7 @@ server {
ssl_prefer_server_ciphers on;
location / {
proxy_http_version 1.1;
proxy_pass http://localhost:8331;
proxy_pass http://192.168.1.157:8311;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
@ -16,6 +16,14 @@ server {
sub_filter '</body>' '<link rel="stylesheet" href="/fediii-static/Kbin.css"/><script src="/fediii-static/Kbin.js"></script></body>';
sub_filter_once on;
}
location /.well-known/mercure {
proxy_pass http://192.168.1.157:3000$request_uri;
proxy_http_version 1.1;
proxy_set_header Connection "";
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
}
location /fediii-static/ {
root /Server/www/;
add_header Access-Control-Allow-Origin *;

View File

@ -0,0 +1,16 @@
server {
listen 443 ssl;
server_name wp-testing.octt.eu.org;
ssl_certificate /etc/letsencrypt/live/wp-testing.octt.eu.org/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/wp-testing.octt.eu.org/privkey.pem;
ssl_prefer_server_ciphers on;
location / {
proxy_http_version 1.1;
proxy_pass http://192.168.1.157:8048;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
}