Compare commits

...
12 Commits
Author SHA1 Message Date
lingkai5wu 5d53aed6c0 feat: update homepage server_name to home subdomain 2026-10-24 23:47:18 +08:00
lingkai5wu 82ff78cae0 feat: add homepage reverse proxy 2026-10-24 21:29:47 +08:00
lingkai5wu 70ef71eefd feat: add miyouqian reverse proxy 2026-10-18 13:06:45 +08:00
lingkai5wu cf4c6983e2 fix: resolve container backends dynamically to allow nginx startup 2026-10-16 16:06:17 +08:00
lingkai5wu c323507de4 chore: disable OCSP stapling (origin cert lacks OCSP URI)
The origin certificate does not include an OCSP responder URL,
causing nginx warnings. Comment out stapling directives until
a proper certificate with OCSP support is deployed.
2026-10-12 13:20:42 +08:00
lingkai5wu ac9e744692 feat: enable OCSP stapling
OCSP stapling improves TLS handshake performance and privacy by
having the server provide certificate revocation status directly,
so clients don't need to query the CA separately.
2026-10-12 13:02:30 +08:00
lingkai5wu a7a1051ea1 feat: redirect HTTP requests to HTTPS
Replace the 404 response on port 80 with a 301 redirect to the
equivalent HTTPS URL, so users who type http:// are seamlessly
upgraded to a secure connection.
2026-10-12 13:00:22 +08:00
lingkai5wu 1be33450f0 chore: disable TLS session tickets
Session tickets weaken forward secrecy; disable them to prevent
past sessions from being decrypted if the ticket key is compromised.
2026-10-12 13:00:10 +08:00
lingkai5wu b01d4e8f1e feat: migrate SSL configuration to centralized https.conf snippet 2026-10-12 12:54:07 +08:00
lingkai5wu fc14ba0e87 fix: enable IPv6 listener for qBittorrent 2026-10-08 13:12:25 +08:00
lingkai5wu c9cce852bf feat: centralize nginx TLS and proxy defaults 2026-09-25 13:13:37 +08:00
lingkai5wu 7cc6b34d31 chore: enforce LF line endings 2026-09-25 13:13:37 +08:00
16 changed files with 109 additions and 39 deletions

No files matched your search

+1
View File
@@ -0,0 +1 @@
* text=auto eol=lf
@@ -1,5 +1,6 @@
map_hash_bucket_size 128;
# Normalize the Connection header for WebSocket upgrades.
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
-17
View File
@@ -1,17 +0,0 @@
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name _;
return 404;
}
server {
listen 443 ssl default_server;
listen [::]:443 ssl default_server;
include snippets/https.conf;
server_name _;
return 404;
}
+5
View File
@@ -0,0 +1,5 @@
# Docker's embedded DNS is available before the other stacks start.
# Resolve container names at runtime so a missing backend cannot stop Nginx.
# Requires Nginx >= 1.27.3 (open-source upstream resolve support).
resolver 127.0.0.11 valid=10s;
resolver_timeout 5s;
+27
View File
@@ -0,0 +1,27 @@
http2 on;
ssl_protocols TLSv1.2 TLSv1.3;
ssl_session_cache shared:SSL:10m;
ssl_session_timeout 10m;
ssl_session_tickets off;
# OCSP stapling requires certificates with an OCSP responder URL.
# Uncomment when the origin certificate supports it.
# ssl_stapling on;
# ssl_stapling_verify on;
# resolver 1.1.1.1 8.8.8.8 valid=300s;
# resolver_timeout 5s;
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name _;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl default_server;
listen [::]:443 ssl default_server;
ssl_reject_handshake on;
}
+6 -2
View File
@@ -1,5 +1,9 @@
upstream adguardhome_backend {
zone adguardhome_backend 64k;
server adguardhome:80 resolve;
}
server {
listen 443 ssl;
include snippets/https.conf;
server_name adguard.${BASE_DOMAIN};
@@ -7,6 +11,6 @@ server {
include snippets/proxy.conf;
location / {
proxy_pass http://adguardhome;
proxy_pass http://adguardhome_backend;
}
}
+6 -2
View File
@@ -1,5 +1,9 @@
upstream backrest_backend {
zone backrest_backend 64k;
server backrest:9898 resolve;
}
server {
listen 443 ssl;
include snippets/https.conf;
server_name backrest.${BASE_DOMAIN};
@@ -7,6 +11,6 @@ server {
include snippets/proxy.conf;
location / {
proxy_pass http://backrest:9898;
proxy_pass http://backrest_backend;
}
}
+6 -3
View File
@@ -1,6 +1,9 @@
upstream gitea_backend {
zone gitea_backend 64k;
server gitea:3000 resolve;
}
server {
listen 443 ssl;
listen [::]:443 ssl;
include snippets/https.conf;
server_name gitea.${BASE_DOMAIN};
@@ -8,7 +11,7 @@ server {
include snippets/proxy.conf;
location / {
proxy_pass http://gitea:3000;
proxy_pass http://gitea_backend;
client_max_body_size 512M;
}
}
-2
View File
@@ -1,6 +1,4 @@
server {
listen 443 ssl;
listen [::]:443 ssl;
include snippets/https.conf;
server_name ha.${BASE_DOMAIN};
+16
View File
@@ -0,0 +1,16 @@
upstream homepage_backend {
zone homepage_backend 64k;
server homepage:3000 resolve;
}
server {
include snippets/https.conf;
server_name home.${BASE_DOMAIN};
include snippets/proxy.conf;
location / {
proxy_pass http://homepage_backend;
}
}
+6 -3
View File
@@ -1,6 +1,9 @@
upstream immich_backend {
zone immich_backend 64k;
server immich-server:2283 resolve;
}
server {
listen 443 ssl;
listen [::]:443 ssl;
include snippets/https.conf;
server_name immich.${BASE_DOMAIN};
@@ -22,7 +25,7 @@ server {
send_timeout 600s;
location / {
proxy_pass http://immich-server:2283;
proxy_pass http://immich_backend;
proxy_redirect off;
}
+16
View File
@@ -0,0 +1,16 @@
upstream miyouqian_backend {
zone miyouqian_backend 64k;
server miyouqian:5890 resolve;
}
server {
include snippets/https.conf;
server_name miyouqian.${BASE_DOMAIN};
include snippets/proxy.conf;
location / {
proxy_pass http://miyouqian_backend;
}
}
+6 -3
View File
@@ -1,6 +1,9 @@
upstream openlist_backend {
zone openlist_backend 64k;
server openlist:5244 resolve;
}
server {
listen 443 ssl;
listen [::]:443 ssl;
include snippets/https.conf;
server_name openlist.${BASE_DOMAIN};
@@ -8,7 +11,7 @@ server {
include snippets/proxy.conf;
location / {
proxy_pass http://openlist:5244;
proxy_pass http://openlist_backend;
proxy_redirect off;
}
}
+6 -2
View File
@@ -1,5 +1,9 @@
upstream qbittorrent_backend {
zone qbittorrent_backend 64k;
server qbittorrent:8080 resolve;
}
server {
listen 443 ssl;
include snippets/https.conf;
server_name qbt.${BASE_DOMAIN};
@@ -7,6 +11,6 @@ server {
include snippets/proxy.conf;
location / {
proxy_pass http://qbittorrent:8080;
proxy_pass http://qbittorrent_backend;
}
}
+3 -1
View File
@@ -1,3 +1,5 @@
http2 on;
listen 443 ssl;
listen [::]:443 ssl;
ssl_certificate /etc/nginx/certs/${BASE_DOMAIN}/fullchain.pem;
ssl_certificate_key /etc/nginx/certs/${BASE_DOMAIN}/key.pem;
+4 -4
View File
@@ -1,19 +1,19 @@
# restrict access
# Allow requests only from the internal network or a trusted gateway.
if ($allow_access = 0) {
return 403;
}
# set headers
# Forward normalized client metadata.
proxy_set_header Host $host;
proxy_set_header X-Real-IP $trusted_client_ip;
proxy_set_header X-Forwarded-For $trusted_client_ip;
proxy_set_header X-Forwarded-Proto $scheme;
# clean headers
# Do not expose gateway authentication metadata to upstream services.
proxy_set_header X-Origin-Token '';
proxy_set_header EO-Connecting-IP '';
# enable websockets: http://nginx.org/en/docs/http/websocket.html
# Support WebSocket upgrades.
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;