nginx-rp: Reorder servers by alphabetical order

This commit is contained in:
Viyurz 2023-12-13 15:11:38 +01:00
parent 830d3bca28
commit 9683592cbc

View file

@ -9,7 +9,6 @@ server {
} }
# Default HTTPS server # Default HTTPS server
server { server {
listen 443 ssl http2 default_server; listen 443 ssl http2 default_server;
@ -22,6 +21,92 @@ server {
} }
# Base domain redirect
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name viyurz.fr;
location = /.well-known/matrix/server {
default_type application/json;
return 200 '{ "m.server": "matrix.viyurz.fr:443" }';
}
location = /.well-known/matrix/client {
default_type application/json;
add_header Access-Control-Allow-Origin '*';
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" always;
add_header Set-Cookie "Path=/; HttpOnly; Secure";
return 200 '{ "m.homeserver": { "base_url": "https://matrix.viyurz.fr" } }';
}
location / {
return 308 https://www.viyurz.fr$request_uri;
}
}
# Homepage
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name www.viyurz.fr;
location / {
proxy_pass http://localhost:8082;
}
}
# Element
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name element.viyurz.fr;
location / {
proxy_pass http://localhost:8084;
add_header X-Frame-Options SAMEORIGIN;
add_header X-Content-Type-Options nosniff;
add_header X-XSS-Protection "1; mode=block";
add_header Content-Security-Policy "frame-ancestors 'none'";
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" always;
add_header X-Robots-Tag "noindex, nofollow" always;
add_header Set-Cookie "Path=/; HttpOnly; Secure";
}
}
# Etebase
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name etebase.viyurz.fr;
location ~ ^/(?!admin) {
proxy_pass http://localhost:3735;
}
}
# Kavita
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name kavita.viyurz.fr;
location / {
proxy_pass http://localhost:5000;
}
}
# Nextcloud # Nextcloud
server { server {
@ -48,33 +133,6 @@ server {
} }
# Vaultwarden
upstream vaultwarden-default {
zone vaultwarden-default 64k;
server localhost:8081;
keepalive 2;
}
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name vw.viyurz.fr;
location / {
proxy_pass http://vaultwarden-default;
# Websocket
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
client_max_body_size 525M;
}
}
# SearxNG # SearxNG
server { server {
listen 443 ssl http2; listen 443 ssl http2;
@ -92,8 +150,7 @@ server {
} }
# Synapse
# Matrix/Synapse
server { server {
listen 443 ssl http2; listen 443 ssl http2;
listen [::]:443 ssl http2; listen [::]:443 ssl http2;
@ -110,7 +167,6 @@ server {
} }
# Syncthing Discovery # Syncthing Discovery
upstream stdisco.viyurz.fr { upstream stdisco.viyurz.fr {
# Local IP address:port for discovery server # Local IP address:port for discovery server
@ -135,93 +191,26 @@ server {
} }
# Vaultwarden
# Etebase upstream vaultwarden-default {
server { zone vaultwarden-default 64k;
listen 443 ssl http2; server localhost:8081;
listen [::]:443 ssl http2; keepalive 2;
server_name etebase.viyurz.fr;
location ~ ^/(?!admin) {
proxy_pass http://localhost:3735;
}
} }
# Element
server { server {
listen 443 ssl http2; listen 443 ssl http2;
listen [::]:443 ssl http2; listen [::]:443 ssl http2;
server_name element.viyurz.fr; server_name vw.viyurz.fr;
location / { location / {
proxy_pass http://localhost:8084; proxy_pass http://vaultwarden-default;
add_header X-Frame-Options SAMEORIGIN; # Websocket
add_header X-Content-Type-Options nosniff; proxy_http_version 1.1;
add_header X-XSS-Protection "1; mode=block"; proxy_set_header Upgrade $http_upgrade;
add_header Content-Security-Policy "frame-ancestors 'none'"; proxy_set_header Connection $connection_upgrade;
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" always; client_max_body_size 525M;
add_header X-Robots-Tag "noindex, nofollow" always;
add_header Set-Cookie "Path=/; HttpOnly; Secure";
}
}
# Kavita
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name kavita.viyurz.fr;
location / {
proxy_pass http://localhost:5000;
}
}
# Homepage
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name www.viyurz.fr;
location / {
proxy_pass http://localhost:8082;
}
}
# Base domain redirect
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name viyurz.fr;
location = /.well-known/matrix/server {
default_type application/json;
return 200 '{ "m.server": "matrix.viyurz.fr:443" }';
}
location = /.well-known/matrix/client {
default_type application/json;
add_header Access-Control-Allow-Origin '*';
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" always;
add_header Set-Cookie "Path=/; HttpOnly; Secure";
return 200 '{ "m.homeserver": { "base_url": "https://matrix.viyurz.fr" } }';
}
location / {
return 308 https://www.viyurz.fr$request_uri;
} }
} }