Refactor Nginx configurations

This commit is contained in:
Michael 2024-11-04 14:52:16 -05:00
parent 925db2c864
commit 6af16b61b8
29 changed files with 315 additions and 810 deletions

View file

@ -1,65 +1,21 @@
map $http_upgrade $connection_upgrade { # Include a common header (Upgrade Websockets, Add Upstreams, Upgrade HTTP to HTTPS)
default upgrade; include snippets/global/common-boilerplate.conf;
'' close;
}
upstream authentik {
server 192.168.1.205:9443;
keepalive 10;
}
server { server {
listen 80;
listen [::]:80;
server_name auth.shad.moe www.auth.shad.moe;
location / {
return 301 https://$host$request_uri;
}
}
server {
listen 443 ssl;
listen [::]:443 ssl;
http2 on;
server_name auth.shad.moe www.auth.shad.moe; server_name auth.shad.moe www.auth.shad.moe;
ssl_certificate /etc/letsencrypt/live/auth.shad.moe/fullchain.pem; ssl_certificate /etc/letsencrypt/live/auth.shad.moe/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/auth.shad.moe/privkey.pem; ssl_certificate_key /etc/letsencrypt/live/auth.shad.moe/privkey.pem;
ssl_session_timeout 1d; ssl_trusted_certificate /etc/letsencrypt/live/auth.shad.moe/fullchain.pem;
ssl_session_cache shared:MozSSL:10m; # about 40000 sessions
ssl_session_tickets off;
ssl_dhparam /etc/nginx/dhparam.txt; include snippets/global/common-ssl.conf;
ssl_protocols TLSv1.2 TLSv1.3; include snippets/proxy/common-proxy-headers.conf;
ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-CHACHA20-POLY1305;
ssl_prefer_server_ciphers off;
add_header Strict-Transport-Security "max-age=63072000" always;
include snippets/http-cat-error-pages.conf;
location / { location / {
proxy_pass https://authentik; proxy_pass https://authentik;
proxy_http_version 1.1;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
} }
ssl_stapling on; include snippets/global/errors/http-cat-error-pages.conf;
ssl_stapling_verify on;
# verify chain of trust of OCSP response using Root CA and Intermediate certs
ssl_trusted_certificate /etc/letsencrypt/live/graph.shad.moe/fullchain.pem;
# replace with the IP address of your resolver
#resolver 127.0.0.1; # Defined in error pages
} }

View file

@ -1,53 +1,17 @@
map $http_upgrade $connection_upgrade { # Include a common header (Upgrade Websockets, Add Upstreams, Upgrade HTTP to HTTPS)
default upgrade; include snippets/global/common-boilerplate.conf;
'' close;
}
#upstream bsky {
# server 100.64.4.102:3000;
#}
server { server {
listen 80;
listen [::]:80;
server_name axoblu.konpeki.solutions; server_name axoblu.konpeki.solutions www.axoblu.konpeki.solutions;
location / {
return 301 https://$host$request_uri;
}
}
server {
listen 443 ssl;
listen [::]:443 ssl;
http2 on;
server_name axoblu.konpeki.solutions;
ssl_certificate /etc/letsencrypt/live/konpeki.solutions/fullchain.pem; ssl_certificate /etc/letsencrypt/live/konpeki.solutions/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/konpeki.solutions/privkey.pem; ssl_certificate_key /etc/letsencrypt/live/konpeki.solutions/privkey.pem;
ssl_session_timeout 1d; ssl_trusted_certificate /etc/letsencrypt/live/konpeki.solutions/fullchain.pem;
ssl_session_cache shared:MozSSL:10m; # about 40000 sessions
ssl_session_tickets off;
ssl_dhparam /etc/nginx/dhparam.txt; include snippets/global/common-ssl.conf;
ssl_protocols TLSv1.2 TLSv1.3; include snippets/proxy/common-proxy-headers.conf;
ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-CHACHA20-POLY1305;
ssl_prefer_server_ciphers off;
add_header Strict-Transport-Security "max-age=63072000" always;
include snippets/http-cat-error-pages.conf;
proxy_set_header Connection $http_connection;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Host $host;
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;
location / { location / {
rewrite / https://bsky.app/profile/did:plc:qxrvqly74uzia6d5pwgwjxb5 break; rewrite / https://bsky.app/profile/did:plc:qxrvqly74uzia6d5pwgwjxb5 break;
@ -63,13 +27,5 @@ server {
default_type text/plain; default_type text/plain;
} }
ssl_stapling on; include snippets/global/errors/http-cat-error-pages.conf;
ssl_stapling_verify on;
# verify chain of trust of OCSP response using Root CA and Intermediate certs
ssl_trusted_certificate /etc/letsencrypt/live/konpeki.solutions/fullchain.pem;
# replace with the IP address of your resolver
#resolver 127.0.0.1; # Defined in error pages
} }

View file

@ -1,41 +1,21 @@
map $http_upgrade $connection_upgrade { # Include a common header (Upgrade Websockets, Add Upstreams, Upgrade HTTP to HTTPS)
default upgrade; include snippets/global/common-boilerplate.conf;
'' close;
}
server { server {
listen 80;
listen [::]:80;
server_name dash.shad.moe www.dash.shad.moe;
if ($host = dash.shad.moe) {
return 301 https://$host$request_uri;
}
return 404;
}
server {
listen 443 ssl;
listen [::]:443 ssl;
http2 on;
server_name dash.shad.moe www.dash.shad.moe; server_name dash.shad.moe www.dash.shad.moe;
ssl_certificate /etc/letsencrypt/live/dash.shad.moe/fullchain.pem; ssl_certificate /etc/letsencrypt/live/dash.shad.moe/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/dash.shad.moe/privkey.pem; ssl_certificate_key /etc/letsencrypt/live/dash.shad.moe/privkey.pem;
ssl_protocols TLSv1.2 TLSv1.3; ssl_trusted_certificate /etc/letsencrypt/live/dash.shad.moe/fullchain.pem;
client_max_body_size 525M;
include snippets/http-cat-error-pages.conf; include snippets/global/common-ssl.conf;
include snippets/proxy/common-proxy-headers.conf;
location / { location / {
proxy_http_version 1.1; proxy_pass https://192.168.1.210:3000;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_set_header Host $host;
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_pass http://192.168.1.210:3000;
} }
include snippets/global/errors/http-cat-error-pages.conf;
} }

View file

@ -1,65 +1,21 @@
map $http_upgrade $connection_upgrade { # Include a common header (Upgrade Websockets, Add Upstreams, Upgrade HTTP to HTTPS)
default upgrade; include snippets/global/common-boilerplate.conf;
'' close;
}
upstream bookstack {
server 100.64.2.118;
}
server { server {
listen 80;
listen [::]:80;
server_name docs.shad.moe www.docs.shad.moe;
location / {
return 301 https://$host$request_uri;
}
}
server {
listen 443 ssl;
listen [::]:443 ssl;
http2 on;
server_name docs.shad.moe www.docs.shad.moe; server_name docs.shad.moe www.docs.shad.moe;
ssl_certificate /etc/letsencrypt/live/docs.shad.moe/fullchain.pem; ssl_certificate /etc/letsencrypt/live/docs.shad.moe/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/docs.shad.moe/privkey.pem; ssl_certificate_key /etc/letsencrypt/live/docs.shad.moe/privkey.pem;
ssl_session_timeout 1d;
ssl_session_cache shared:MozSSL:10m; # about 40000 sessions
ssl_session_tickets off;
ssl_dhparam /etc/nginx/dhparam.txt;
ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305;
ssl_prefer_server_ciphers off;
add_header Strict-Transport-Security "max-age=63072000" always;
include snippets/http-cat-error-pages.conf;
location / {
client_max_body_size 512M;
proxy_pass http://bookstack;
proxy_set_header Connection $http_connection;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Host $host;
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;
}
ssl_stapling on;
ssl_stapling_verify on;
# verify chain of trust of OCSP response using Root CA and Intermediate certs
ssl_trusted_certificate /etc/letsencrypt/live/docs.shad.moe/fullchain.pem; ssl_trusted_certificate /etc/letsencrypt/live/docs.shad.moe/fullchain.pem;
# replace with the IP address of your resolver include snippets/global/common-ssl.conf;
#resolver 127.0.0.1; # Defined in error pages
include snippets/proxy/common-proxy-headers.conf;
location / {
proxy_pass https://bookstack;
}
include snippets/global/errors/http-cat-error-pages.conf;
} }

View file

@ -1,65 +1,21 @@
map $http_upgrade $connection_upgrade { # Include a common header (Upgrade Websockets, Add Upstreams, Upgrade HTTP to HTTPS)
default upgrade; include snippets/global/common-boilerplate.conf;
'' close;
}
upstream gitea {
server 192.168.1.215:3000;
}
server { server {
listen 80;
listen [::]:80;
server_name git.shad.moe www.git.shad.moe;
location / {
return 301 https://$host$request_uri;
}
}
server {
listen 443 ssl;
listen [::]:443 ssl;
http2 on;
server_name git.shad.moe www.git.shad.moe; server_name git.shad.moe www.git.shad.moe;
ssl_certificate /etc/letsencrypt/live/git.shad.moe/fullchain.pem; ssl_certificate /etc/letsencrypt/live/git.shad.moe/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/git.shad.moe/privkey.pem; ssl_certificate_key /etc/letsencrypt/live/git.shad.moe/privkey.pem;
ssl_session_timeout 1d;
ssl_session_cache shared:MozSSL:10m; # about 40000 sessions
ssl_session_tickets off;
ssl_dhparam /etc/nginx/dhparam.txt;
ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-CHACHA20-POLY1305;
ssl_prefer_server_ciphers off;
add_header Strict-Transport-Security "max-age=63072000" always;
include snippets/http-cat-error-pages.conf;
location / {
client_max_body_size 512M;
proxy_pass http://gitea;
proxy_set_header Connection $http_connection;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Host $host;
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;
}
ssl_stapling on;
ssl_stapling_verify on;
# verify chain of trust of OCSP response using Root CA and Intermediate certs
ssl_trusted_certificate /etc/letsencrypt/live/git.shad.moe/fullchain.pem; ssl_trusted_certificate /etc/letsencrypt/live/git.shad.moe/fullchain.pem;
# replace with the IP address of your resolver include snippets/global/common-ssl.conf;
#resolver 127.0.0.1; # Defined in error pages
include snippets/proxy/common-proxy-headers.conf;
location / {
proxy_pass https://gitea;
}
include snippets/global/errors/http-cat-error-pages.conf;
} }

View file

@ -1,68 +1,21 @@
map $http_upgrade $connection_upgrade { # Include a common header (Upgrade Websockets, Add Upstreams, Upgrade HTTP to HTTPS)
default upgrade; include snippets/global/common-boilerplate.conf;
'' close;
}
upstream grafana {
server 192.168.1.200:3000;
}
server { server {
listen 80;
listen [::]:80;
server_name graph.shad.moe www.graph.shad.moe;
location / {
return 301 https://$host$request_uri;
}
}
server {
listen 443 ssl;
listen [::]:443 ssl;
http2 on;
server_name graph.shad.moe www.graph.shad.moe; server_name graph.shad.moe www.graph.shad.moe;
ssl_certificate /etc/letsencrypt/live/graph.shad.moe/fullchain.pem; ssl_certificate /etc/letsencrypt/live/graph.shad.moe/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/graph.shad.moe/privkey.pem; ssl_certificate_key /etc/letsencrypt/live/graph.shad.moe/privkey.pem;
ssl_session_timeout 1d;
ssl_session_cache shared:MozSSL:10m; # about 40000 sessions
ssl_session_tickets off;
ssl_dhparam /etc/nginx/dhparam.txt;
ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-CHACHA20-POLY1305;
ssl_prefer_server_ciphers off;
add_header Strict-Transport-Security "max-age=63072000" always;
include snippets/http-cat-error-pages.conf;
location / {
proxy_set_header Host $host;
proxy_pass http://grafana;
}
# Proxy Grafana Live WebSocket connections.
location /api/live/ {
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_set_header Host $host;
proxy_pass http://grafana;
}
ssl_stapling on;
ssl_stapling_verify on;
# verify chain of trust of OCSP response using Root CA and Intermediate certs
ssl_trusted_certificate /etc/letsencrypt/live/graph.shad.moe/fullchain.pem; ssl_trusted_certificate /etc/letsencrypt/live/graph.shad.moe/fullchain.pem;
# replace with the IP address of your resolver include snippets/global/common-ssl.conf;
#resolver 127.0.0.1; # Defined in error pages
include snippets/proxy/common-proxy-headers.conf;
location / {
proxy_pass https://grafana;
}
include snippets/global/errors/http-cat-error-pages.conf;
} }

View file

@ -1,22 +1,36 @@
# Include a common header (Upgrade Websockets, Add Upstreams, Upgrade HTTP to HTTPS)
include snippets/global/common-boilerplate.conf;
server { server {
listen 443 ssl;
server_name internal.shad.moe; server_name internal.shad.moe www.internal.shad.moe;
ssl_certificate /etc/letsencrypt/live/internal.shad.moe/fullchain.pem;
ssl_certificate /etc/letsencrypt/live/internal.shad.moe/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/internal.shad.moe/privkey.pem; ssl_certificate_key /etc/letsencrypt/live/internal.shad.moe/privkey.pem;
#ssl_protocols TLSv1.2 TLSv1.3; ssl_trusted_certificate /etc/letsencrypt/live/internal.shad.moe/fullchain.pem;
#ssl_ciphers HIGH:!aNULL:!MD5;
include snippets/global/common-ssl.conf;
include snippets/global/common-headers.conf;
root /var/www/internal-page-wall; root /var/www/internal-page-wall;
location / { location / {
index index.htm index.html; index index.htm index.html;
} }
include snippets/global/errors/http-cat-error-pages.conf;
} }
server { server {
listen 443 ssl;
server_name *.internal.shad.moe; server_name *.internal.shad.moe;
ssl_certificate /etc/letsencrypt/live/internal.shad.moe/fullchain.pem;
ssl_certificate /etc/letsencrypt/live/internal.shad.moe/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/internal.shad.moe/privkey.pem; ssl_certificate_key /etc/letsencrypt/live/internal.shad.moe/privkey.pem;
ssl_trusted_certificate /etc/letsencrypt/live/internal.shad.moe/fullchain.pem;
include snippets/global/common-ssl.conf;
return 302 https://internal.shad.moe; return 302 https://internal.shad.moe;
} }

View file

@ -1,53 +1,17 @@
map $http_upgrade $connection_upgrade { # Include a common header (Upgrade Websockets, Add Upstreams, Upgrade HTTP to HTTPS)
default upgrade; include snippets/global/common-boilerplate.conf;
'' close;
}
upstream bsky {
server 100.64.4.102:3000;
}
server { server {
listen 80;
listen [::]:80;
server_name konpeki.solutions www.konpeki.solutions;
location / {
return 301 https://$host$request_uri;
}
}
server {
listen 443 ssl;
listen [::]:443 ssl;
http2 on;
server_name konpeki.solutions www.konpeki.solutions; server_name konpeki.solutions www.konpeki.solutions;
ssl_certificate /etc/letsencrypt/live/konpeki.solutions/fullchain.pem; ssl_certificate /etc/letsencrypt/live/konpeki.solutions/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/konpeki.solutions/privkey.pem; ssl_certificate_key /etc/letsencrypt/live/konpeki.solutions/privkey.pem;
ssl_session_timeout 1d; ssl_trusted_certificate /etc/letsencrypt/live/konpeki.solutions/fullchain.pem;
ssl_session_cache shared:MozSSL:10m; # about 40000 sessions
ssl_session_tickets off;
ssl_dhparam /etc/nginx/dhparam.txt; include snippets/global/common-ssl.conf;
ssl_protocols TLSv1.2 TLSv1.3; include snippets/proxy/common-proxy-headers.conf;
ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-CHACHA20-POLY1305;
ssl_prefer_server_ciphers off;
add_header Strict-Transport-Security "max-age=63072000" always;
include snippets/http-cat-error-pages.conf;
proxy_set_header Connection $http_connection;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Host $host;
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;
location / { location / {
client_max_body_size 512M; client_max_body_size 512M;
@ -59,13 +23,5 @@ server {
proxy_pass http://bsky; proxy_pass http://bsky;
} }
ssl_stapling on; include snippets/global/errors/http-cat-error-pages.conf;
ssl_stapling_verify on;
# verify chain of trust of OCSP response using Root CA and Intermediate certs
ssl_trusted_certificate /etc/letsencrypt/live/konpeki.solutions/fullchain.pem;
# replace with the IP address of your resolver
#resolver 127.0.0.1; # Defined in error pages
} }

View file

@ -1,51 +1,24 @@
server { # Include a common header (Upgrade Websockets, Add Upstreams, Upgrade HTTP to HTTPS)
listen 80; include snippets/global/common-boilerplate.conf;
server_name link.gpoc.konpeki.solutions;
return 301 https://$server_name$request_uri;
}
server { server {
listen 443 ssl;
server_name link.gpoc.konpeki.solutions;
http2 on; server_name link.gpoc.shad.moe www.link.gpoc.shad.moe;
# allow larger file uploads and longer script runtimes ssl_certificate /etc/letsencrypt/live/link.gpoc.shad.moe/fullchain.pem;
client_max_body_size 100m; ssl_certificate_key /etc/letsencrypt/live/link.gpoc.shad.moe/privkey.pem;
client_body_timeout 120s; ssl_trusted_certificate /etc/letsencrypt/live/link.gpoc.shad.moe/fullchain.pem;
sendfile off; include snippets/global/common-ssl.conf;
ssl_certificate /etc/letsencrypt/live/link.gpoc.konpeki.solutions/fullchain.pem; include snippets/proxy/common-proxy-headers.conf;
ssl_certificate_key /etc/letsencrypt/live/link.gpoc.konpeki.solutions/privkey.pem;
ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers "ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384";
ssl_prefer_server_ciphers on;
# See https://hstspreload.org/ before uncommenting the line below.
# add_header Strict-Transport-Security "max-age=15768000; preload;";
#add_header X-Content-Type-Options nosniff;
#add_header X-XSS-Protection "1; mode=block";
#add_header X-Robots-Tag none;
#add_header Content-Security-Policy "frame-ancestors 'self'";
#add_header X-Frame-Options DENY;
#add_header Referrer-Policy same-origin;
add_header Access-Control-Allow-Origin *; add_header Access-Control-Allow-Origin *;
proxy_set_header Content-Security-Policy upgrade-insecure-requests; proxy_set_header Content-Security-Policy upgrade-insecure-requests;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_redirect off;
proxy_buffering off;
proxy_request_buffering off;
location / { location / {
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_pass http://100.64.4.100:8080/; proxy_pass http://100.64.4.100:8080/;
} }
include snippets/global/errors/http-cat-error-pages.conf;
} }

View file

@ -1,50 +1,21 @@
# Include a common header (Upgrade Websockets, Add Upstreams, Upgrade HTTP to HTTPS)
include snippets/global/common-boilerplate.conf;
proxy_cache_path /var/www/cache levels=1:2 keys_zone=map:8m max_size=1g inactive=24h; proxy_cache_path /var/www/cache levels=1:2 keys_zone=map:8m max_size=1g inactive=24h;
server { server {
listen 80;
server_name map.gpoc.konpeki.solutions;
return 301 https://$server_name$request_uri;
}
server { server_name auth.shad.moe www.auth.shad.moe;
listen 443 ssl;
server_name map.gpoc.konpeki.solutions;
http2 on; ssl_certificate /etc/letsencrypt/live/auth.shad.moe/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/auth.shad.moe/privkey.pem;
ssl_trusted_certificate /etc/letsencrypt/live/auth.shad.moe/fullchain.pem;
# allow larger file uploads and longer script runtimes include snippets/global/common-ssl.conf;
#client_max_body_size 100m;
#client_body_timeout 120s;
#sendfile off; include snippets/proxy/common-proxy-headers.conf;
ssl_certificate /etc/letsencrypt/live/map.gpoc.konpeki.solutions/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/map.gpoc.konpeki.solutions/privkey.pem;
#ssl_protocols TLSv1.2 TLSv1.3;
#ssl_ciphers "ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES2>
#ssl_prefer_server_ciphers on;
# See https://hstspreload.org/ before uncommenting the line below.
# add_header Strict-Transport-Security "max-age=15768000; preload;";
#add_header X-Content-Type-Options nosniff;
#add_header X-XSS-Protection "1; mode=block";
#add_header X-Robots-Tag none;
#add_header Content-Security-Policy "frame-ancestors 'self'";
#add_header X-Frame-Options DENY;
#add_header Referrer-Policy same-origin;
#add_header Access-Control-Allow-Origin *;
#proxy_set_header Content-Security-Policy upgrade-insecure-requests;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_redirect off;
proxy_buffering off;
proxy_request_buffering off;
location / { location / {
proxy_pass http://100.64.4.100:8123/;
proxy_set_header Host $host; proxy_set_header Host $host;
proxy_cache map; proxy_cache map;
proxy_cache_key "$host$uri"; proxy_cache_key "$host$uri";
@ -52,5 +23,9 @@ server {
proxy_cache_valid 404 10m; proxy_cache_valid 404 10m;
proxy_cache_use_stale error timeout invalid_header updating http_500 http_503 http_504; proxy_cache_use_stale error timeout invalid_header updating http_500 http_503 http_504;
proxy_connect_timeout 10; proxy_connect_timeout 10;
proxy_pass http://100.64.4.100:8123/;
} }
include snippets/global/errors/http-cat-error-pages.conf;
} }

View file

@ -1,87 +1,21 @@
map $http_upgrade $connection_upgrade { # Include a common header (Upgrade Websockets, Add Upstreams, Upgrade HTTP to HTTPS)
default upgrade; include snippets/global/common-boilerplate.conf;
'' close;
}
server { server {
listen 80;
listen [::]:80;
server_name nxt.shad.moe www.nxt.shad.moe;
location / {
return 301 https://$host$request_uri;
}
}
server {
listen 443 ssl;
listen [::]:443 ssl;
http2 on;
# http3 on;
# quic_retry on;
# add_header Alt-Svc 'h3=":443"; ma=86400';
# listen 443 quic reuseport;
# listen [::]:443 quic reuseport;
server_name nxt.shad.moe www.nxt.shad.moe; server_name nxt.shad.moe www.nxt.shad.moe;
ssl_certificate /etc/letsencrypt/live/nxt.shad.moe/fullchain.pem; ssl_certificate /etc/letsencrypt/live/nxt.shad.moe/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/nxt.shad.moe/privkey.pem; ssl_certificate_key /etc/letsencrypt/live/nxt.shad.moe/privkey.pem;
ssl_session_timeout 1d; ssl_trusted_certificate /etc/letsencrypt/live/nxt.shad.moe/fullchain.pem;
ssl_session_cache shared:MozSSL:10m; # about 40000 sessions
ssl_session_tickets off;
ssl_dhparam /etc/nginx/dhparam.txt; include snippets/global/common-ssl.conf;
ssl_protocols TLSv1.2 TLSv1.3; include snippets/proxy/common-proxy-headers.conf;
ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-CHACHA20-POLY1305;
ssl_prefer_server_ciphers off;
add_header Strict-Transport-Security "max-age=63072000" always;
# Set .mjs and .wasm MIME types
# Either include it in the default mime.types list
# and include that list explicitly or add the file extension
# only for Nextcloud like below:
include mime.types;
#types {
# text/javascript js mjs;
# application/wasm wasm;
#}
include snippets/http-cat-error-pages.conf;
location / { location / {
proxy_pass https://192.168.1.66; proxy_pass https://192.168.1.66;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Port $server_port;
proxy_set_header X-Forwarded-Scheme $scheme;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Accept-Encoding "";
proxy_set_header Host $host;
client_body_buffer_size 512k;
proxy_read_timeout 86400s;
client_max_body_size 0;
# Websocket
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
} }
ssl_stapling on; include snippets/global/errors/http-cat-error-pages.conf;
ssl_stapling_verify on;
ssl_trusted_certificate /etc/letsencrypt/live/nxt.shad.moe/fullchain.pem;
# replace with the IP address of your resolver
#resolver 127.0.0.1; # Defined in error pages
} }

View file

@ -1,45 +1,24 @@
server { # Include a common header (Upgrade Websockets, Add Upstreams, Upgrade HTTP to HTTPS)
listen 80; include snippets/global/common-boilerplate.conf;
server_name play.gpoc-modded.konpeki.solutions;
return 301 https://$server_name$request_uri;
}
server { server {
listen 443 ssl;
server_name play.gpoc-modded.konpeki.solutions;
http2 on; server_name play.gpoc-modded.shad.moe www.play.gpoc-modded.shad.moe;
# allow larger file uploads and longer script runtimes ssl_certificate /etc/letsencrypt/live/play.gpoc-modded.shad.moe/fullchain.pem;
client_max_body_size 100m; ssl_certificate_key /etc/letsencrypt/live/play.gpoc-modded.shad.moe/privkey.pem;
client_body_timeout 120s; ssl_trusted_certificate /etc/letsencrypt/live/play.gpoc-modded.shad.moe/fullchain.pem;
sendfile off; include snippets/global/common-ssl.conf;
ssl_certificate /etc/letsencrypt/live/play.gpoc-modded.konpeki.solutions/fullchain.pem; include snippets/proxy/common-proxy-headers.conf;
ssl_certificate_key /etc/letsencrypt/live/play.gpoc-modded.konpeki.solutions/privkey.pem;
ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers "ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384";
ssl_prefer_server_ciphers on;
# See https://hstspreload.org/ before uncommenting the line below. add_header Access-Control-Allow-Origin *;
# add_header Strict-Transport-Security "max-age=15768000; preload;"; proxy_set_header Content-Security-Policy upgrade-insecure-requests;
add_header X-Content-Type-Options nosniff;
add_header X-XSS-Protection "1; mode=block";
add_header X-Robots-Tag none;
add_header Content-Security-Policy "frame-ancestors 'self'";
add_header X-Frame-Options DENY;
add_header Referrer-Policy same-origin;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_redirect off;
proxy_buffering off;
proxy_request_buffering off;
location / { location / {
proxy_pass http://100.64.4.102; proxy_pass http://100.64.4.102/;
} }
include snippets/global/errors/http-cat-error-pages.conf;
} }

View file

@ -1,51 +1,24 @@
server { # Include a common header (Upgrade Websockets, Add Upstreams, Upgrade HTTP to HTTPS)
listen 80; include snippets/global/common-boilerplate.conf;
server_name play.gpoc.konpeki.solutions;
return 301 https://$server_name$request_uri;
}
server { server {
listen 443 ssl;
server_name play.gpoc.konpeki.solutions;
http2 on; server_name play.gpoc.shad.moe www.play.gpoc.shad.moe;
# allow larger file uploads and longer script runtimes ssl_certificate /etc/letsencrypt/live/play.gpoc.shad.moe/fullchain.pem;
client_max_body_size 100m; ssl_certificate_key /etc/letsencrypt/live/play.gpoc.shad.moe/privkey.pem;
client_body_timeout 120s; ssl_trusted_certificate /etc/letsencrypt/live/play.gpoc.shad.moe/fullchain.pem;
sendfile off; include snippets/global/common-ssl.conf;
ssl_certificate /etc/letsencrypt/live/play.gpoc.konpeki.solutions/fullchain.pem; include snippets/proxy/common-proxy-headers.conf;
ssl_certificate_key /etc/letsencrypt/live/play.gpoc.konpeki.solutions/privkey.pem;
ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers "ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384";
ssl_prefer_server_ciphers on;
# See https://hstspreload.org/ before uncommenting the line below.
# add_header Strict-Transport-Security "max-age=15768000; preload;";
#add_header X-Content-Type-Options nosniff;
#add_header X-XSS-Protection "1; mode=block";
#add_header X-Robots-Tag none;
#add_header Content-Security-Policy "frame-ancestors 'self'";
#add_header X-Frame-Options DENY;
#add_header Referrer-Policy same-origin;
add_header Access-Control-Allow-Origin *; add_header Access-Control-Allow-Origin *;
proxy_set_header Content-Security-Policy upgrade-insecure-requests; proxy_set_header Content-Security-Policy upgrade-insecure-requests;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_redirect off;
proxy_buffering off;
proxy_request_buffering off;
location / { location / {
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_pass http://100.64.4.100:8080/; proxy_pass http://100.64.4.100:8080/;
} }
include snippets/global/errors/http-cat-error-pages.conf;
} }

View file

@ -1,57 +1,21 @@
upstream freshrss { # Include a common header (Upgrade Websockets, Add Upstreams, Upgrade HTTP to HTTPS)
server 192.168.1.219:8080; include snippets/global/common-boilerplate.conf;
keepalive 64;
}
server { server {
listen 80;
listen [::]:80;
server_name rss.shad.moe www.rss.shad.moe; server_name rss.shad.moe www.rss.shad.moe;
location / { ssl_certificate /etc/letsencrypt/live/rss.shad.moe/fullchain.pem;
return 301 https://$host$request_uri; ssl_certificate_key /etc/letsencrypt/live/rss.shad.moe/privkey.pem;
} ssl_trusted_certificate /etc/letsencrypt/live/rss.shad.moe/fullchain.pem;
}
include snippets/global/common-ssl.conf;
server {
server_name rss.shad.moe www.rss.shad.moe; include snippets/proxy/common-proxy-headers.conf;
listen 443 ssl;
listen [::]:443 ssl; location / {
proxy_pass http://freshrss/;
http2 on; }
ssl_certificate /etc/letsencrypt/live/rss.shad.moe/fullchain.pem; include snippets/global/errors/http-cat-error-pages.conf;
ssl_certificate_key /etc/letsencrypt/live/rss.shad.moe/privkey.pem;
ssl_session_timeout 1d;
ssl_session_cache shared:MozSSL:10m; # about 40000 sessions
ssl_session_tickets off;
ssl_dhparam /etc/nginx/dhparam.txt;
ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305;
ssl_prefer_server_ciphers off;
add_header Strict-Transport-Security "max-age=63072000" always;
include snippets/http-cat-error-pages.conf;
location / {
proxy_pass http://freshrss/;
add_header X-Frame-Options SAMEORIGIN;
add_header X-XSS-Protection "1; mode=block";
proxy_redirect off;
proxy_buffering off;
proxy_set_header Host $host;
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 X-Forwarded-Port $server_port;
proxy_read_timeout 90;
# Forward the Authorization header for the Google Reader API.
proxy_set_header Authorization $http_authorization;
proxy_pass_header Authorization;
}
} }

View file

@ -1,53 +1,17 @@
map $http_upgrade $connection_upgrade { # Include a common header (Upgrade Websockets, Add Upstreams, Upgrade HTTP to HTTPS)
default upgrade; include snippets/global/common-boilerplate.conf;
'' close;
}
#upstream bsky {
# server 100.64.4.102:3000;
#}
server { server {
listen 80;
listen [::]:80;
server_name theshadoweevee.konpeki.solutions; server_name theshadoweevee.konpeki.solutions www.theshadoweevee.konpeki.solutions;
location / {
return 301 https://$host$request_uri;
}
}
server {
listen 443 ssl;
listen [::]:443 ssl;
http2 on;
server_name theshadoweevee.konpeki.solutions;
ssl_certificate /etc/letsencrypt/live/konpeki.solutions/fullchain.pem; ssl_certificate /etc/letsencrypt/live/konpeki.solutions/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/konpeki.solutions/privkey.pem; ssl_certificate_key /etc/letsencrypt/live/konpeki.solutions/privkey.pem;
ssl_session_timeout 1d; ssl_trusted_certificate /etc/letsencrypt/live/konpeki.solutions/fullchain.pem;
ssl_session_cache shared:MozSSL:10m; # about 40000 sessions
ssl_session_tickets off;
ssl_dhparam /etc/nginx/dhparam.txt; include snippets/global/common-ssl.conf;
ssl_protocols TLSv1.2 TLSv1.3; include snippets/proxy/common-proxy-headers.conf;
ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-CHACHA20-POLY1305;
ssl_prefer_server_ciphers off;
add_header Strict-Transport-Security "max-age=63072000" always;
include snippets/http-cat-error-pages.conf;
proxy_set_header Connection $http_connection;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Host $host;
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;
location / { location / {
rewrite / https://bsky.app/profile/did:plc:krbzbucjaj76xjob6ju47ilo break; rewrite / https://bsky.app/profile/did:plc:krbzbucjaj76xjob6ju47ilo break;
@ -63,13 +27,5 @@ server {
default_type text/plain; default_type text/plain;
} }
ssl_stapling on; include snippets/global/errors/http-cat-error-pages.conf;
ssl_stapling_verify on;
# verify chain of trust of OCSP response using Root CA and Intermediate certs
ssl_trusted_certificate /etc/letsencrypt/live/konpeki.solutions/fullchain.pem;
# replace with the IP address of your resolver
#resolver 127.0.0.1; # Defined in error pages
} }

View file

@ -1,49 +1,26 @@
upstream vaultwarden-default { # Include a common header (Upgrade Websockets, Add Upstreams, Upgrade HTTP to HTTPS)
zone vaultwarden-default 64k; include snippets/global/common-boilerplate.conf;
server 192.168.1.209:8000;
keepalive 2;
}
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
server {
listen 80;
listen [::]:80;
server_name vault.shad.moe www.vault.shad.moe;
if ($host = vault.shad.moe) {
return 301 https://$host$request_uri;
}
return 404;
}
server { server {
listen 443 ssl;
listen [::]:443 ssl;
http2 on;
server_name vault.shad.moe www.vault.shad.moe; server_name vault.shad.moe www.vault.shad.moe;
ssl_certificate /etc/letsencrypt/live/vault.shad.moe/fullchain.pem; ssl_certificate /etc/letsencrypt/live/vault.shad.moe/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/vault.shad.moe/privkey.pem; ssl_certificate_key /etc/letsencrypt/live/vault.shad.moe/privkey.pem;
ssl_protocols TLSv1.2 TLSv1.3; ssl_trusted_certificate /etc/letsencrypt/live/vault.shad.moe/fullchain.pem;
client_max_body_size 525M;
include snippets/http-cat-error-pages.conf; include snippets/global/common-ssl.conf;
include snippets/proxy/common-proxy-headers.conf;
location / { location / {
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_set_header Host $host;
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_pass http://vaultwarden-default; proxy_pass http://vaultwarden-default;
} }
location /admin { location /admin {
return 403; return 403;
} }
include snippets/global/errors/http-cat-error-pages.conf;
} }

View file

@ -1,56 +1,19 @@
map $http_upgrade $connection_upgrade { # Include a common header (Upgrade Websockets, Add Upstreams, Upgrade HTTP to HTTPS)
default upgrade; include snippets/global/common-boilerplate.conf;
'' close;
}
#upstream bsky {
# server 100.64.4.102:3000;
#}
server { server {
listen 80;
listen [::]:80;
server_name *.konpeki.solutions;
location / {
return 301 https://$host$request_uri;
}
}
server {
listen 443 ssl;
listen [::]:443 ssl;
http2 on;
server_name *.konpeki.solutions; server_name *.konpeki.solutions;
ssl_certificate /etc/letsencrypt/live/konpeki.solutions/fullchain.pem; ssl_certificate /etc/letsencrypt/live/konpeki.solutions/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/konpeki.solutions/privkey.pem; ssl_certificate_key /etc/letsencrypt/live/konpeki.solutions/privkey.pem;
ssl_session_timeout 1d; ssl_trusted_certificate /etc/letsencrypt/live/konpeki.solutions/fullchain.pem;
ssl_session_cache shared:MozSSL:10m; # about 40000 sessions
ssl_session_tickets off;
ssl_dhparam /etc/nginx/dhparam.txt; include snippets/global/common-ssl.conf;
ssl_protocols TLSv1.2 TLSv1.3; include snippets/proxy/common-proxy-headers.conf;
ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-CHACHA20-POLY1305;
ssl_prefer_server_ciphers off;
add_header Strict-Transport-Security "max-age=63072000" always;
include snippets/http-cat-error-pages.conf;
proxy_set_header Connection $http_connection;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Host $host;
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;
location / { location / {
client_max_body_size 512M;
#proxy_pass http://100.64.4.102; #proxy_pass http://100.64.4.102;
return 404; return 404;
} }
@ -59,13 +22,5 @@ server {
proxy_pass http://bsky; proxy_pass http://bsky;
} }
ssl_stapling on; include snippets/global/errors/http-cat-error-pages.conf;
ssl_stapling_verify on;
# verify chain of trust of OCSP response using Root CA and Intermediate certs
ssl_trusted_certificate /etc/letsencrypt/live/konpeki.solutions/fullchain.pem;
# replace with the IP address of your resolver
#resolver 127.0.0.1; # Defined in error pages
} }

View file

@ -3,6 +3,7 @@ types {
text/html html htm shtml; text/html html htm shtml;
text/css css; text/css css;
text/xml xml; text/xml xml;
text/javascript js mjs;
image/gif gif; image/gif gif;
image/jpeg jpeg jpg; image/jpeg jpeg jpg;
application/javascript js mjs; application/javascript js mjs;

View file

@ -29,10 +29,6 @@ http {
include /etc/nginx/mime.types; include /etc/nginx/mime.types;
default_type application/octet-stream; default_type application/octet-stream;
# Name servers used to resolve names of upstream servers into addresses.
# It's also needed when using tcpsocket and udpsocket in Lua modules.
#resolver 1.1.1.1 1.0.0.1 [2606:4700:4700::1111] [2606:4700:4700::1001];
# Don't tell nginx version to the clients. Default is 'on'. # Don't tell nginx version to the clients. Default is 'on'.
server_tokens off; server_tokens off;
@ -40,55 +36,20 @@ http {
# indicated by the request header Content-Length. If the stated content # indicated by the request header Content-Length. If the stated content
# length is greater than this size, then the client receives the HTTP # length is greater than this size, then the client receives the HTTP
# error code 413. Set to 0 to disable. Default is '1m'. # error code 413. Set to 0 to disable. Default is '1m'.
client_max_body_size 100m; client_max_body_size 1G;
client_body_timeout 120s
# Sendfile copies data between one FD and other from within the kernel, # Sendfile copies data between one FD and other from within the kernel,
# which is more efficient than read() + write(). Default is off. # which is more efficient than read() + write(). Default is off.
sendfile on; sendfile on;
# Causes nginx to attempt to send its HTTP response head in one packet,
# instead of using partial frames. Default is 'off'.
tcp_nopush on;
# Enables the specified protocols. Default is TLSv1 TLSv1.1 TLSv1.2.
# TIP: If you're not obligated to support ancient clients, remove TLSv1.1.
ssl_protocols TLSv1.1 TLSv1.2 TLSv1.3;
# Path of the file with Diffie-Hellman parameters for EDH ciphers.
# TIP: Generate with: `openssl dhparam -out /etc/ssl/nginx/dh2048.pem 2048`
#ssl_dhparam /etc/ssl/nginx/dh2048.pem;
# Specifies that our cipher suits should be preferred over client ciphers.
# Default is 'off'.
ssl_prefer_server_ciphers on;
# Enables a shared SSL cache with size that can hold around 8000 sessions.
# Default is 'none'.
ssl_session_cache shared:SSL:2m;
# Specifies a time during which a client may reuse the session parameters.
# Default is '5m'.
ssl_session_timeout 1h;
# Disable TLS session tickets (they are insecure). Default is 'on'.
ssl_session_tickets off;
# Enable gzipping of responses. # Enable gzipping of responses.
#gzip on; gzip on;
# Set the Vary HTTP header as defined in the RFC 2616. Default is 'off'. # Set the Vary HTTP header as defined in the RFC 2616. Default is 'off'.
gzip_vary on; gzip_vary on;
# Helper variable for proxying websockets.
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
# Specifies the main log format. # Specifies the main log format.
log_format main '$remote_addr - $remote_user [$time_local] "$request" ' log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" ' '$status $body_bytes_sent "$http_referer" '
@ -97,7 +58,6 @@ http {
# Sets the path, format, and configuration for a buffered log write. # Sets the path, format, and configuration for a buffered log write.
access_log /var/log/nginx/access.log main; access_log /var/log/nginx/access.log main;
# Includes virtual hosts configs. # Includes virtual hosts configs.
include /etc/nginx/http.d/*; include /etc/nginx/http.d/*;
} }

View file

@ -0,0 +1,8 @@
# Upgrade Websocket Connections
include snippets/websocket-upgrade.conf;
# Add Upstreams Master List
include snippets/upstreams-list.conf;
# Upgrade HTTP Connections to HTTPS
include snippets/upgrade-http.conf;

View file

@ -0,0 +1,8 @@
# Set a common group of headers
add_header X-Content-Type-Options nosniff;
add_header X-XSS-Protection "1; mode=block";
add_header X-Robots-Tag none;
add_header Content-Security-Policy "frame-ancestors 'self'";
add_header X-Frame-Options DENY;
add_header Referrer-Policy same-origin;
add_header Access-Control-Allow-Origin *;

View file

@ -0,0 +1,42 @@
# Many of these parameters configured based on https://ssl-config.mozilla.org/#server=nginx&version=1.26.0&config=intermediate&openssl=1.1.1w&guideline=5.7
# Listen on port 443 (IPv4/IPv6)
listen 443 ssl;
listen [::]:443 ssl;
# Listen on port 443 with quic (IPv4/IPv6)
listen 443 quic reuseport;
listen [::]:443 quic reuseport;
# Enable http2
http2 on;
# Enable http3
http3 on;
# Enable QUIC Functions
quic_retry on;
add_header Alt-Svc 'h3=":443"; ma=86400';
# Set SSL Session Parameters
ssl_session_timeout 1d;
ssl_session_cache shared:MozSSL:10m; # about 40000 sessions
ssl_session_tickets off;
# Configure DHParam
ssl_dhparam /etc/nginx/dhparam.txt;
# Intermediate SSL Configuration
ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-CHACHA20-POLY1305;
ssl_prefer_server_ciphers off;
# HSTS (ngx_http_headers_module is required) (63072000 seconds)
add_header Strict-Transport-Security "max-age=63072000" always;
# OCSP stapling
ssl_stapling on;
ssl_stapling_verify on;
# Include a resolver for OSCP Stapling
include snippets/resolver.conf;

View file

@ -26,4 +26,5 @@ location ~ ^/test-status-cats/(?<cat>.*)$ {
proxy_pass https://http.cat/$cat/; proxy_pass https://http.cat/$cat/;
} }
resolver 100.100.100.100; # Include a resolver for domain resolution
include snippets/resolver.conf;

View file

View file

@ -0,0 +1,10 @@
server {
listen 80;
listen [::]:80;
server_name *;
location / {
return 301 https://$host$request_uri;
}
}

View file

@ -0,0 +1,4 @@
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}

View file

@ -0,0 +1,19 @@
# Set a common group of proxy headers
proxy_http_version 1.1;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Scheme $scheme;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Port $server_port;
proxy_set_header Host $http_host;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_set_header Accept-Encoding "";
# Forward the Authorization header when passed
proxy_set_header Authorization $http_authorization;
proxy_pass_header Authorization;
include snippets/global/common-headers.conf;

View file

@ -0,0 +1,6 @@
# Settings for proxy connections
proxy_read_timeout 90;
proxy_redirect off;
proxy_buffering off;
proxy_request_buffering off;

View file

@ -0,0 +1,33 @@
# List of all upstreams
upstream authentik {
server 192.168.1.205:9443;
keepalive 10;
}
upstream bookstack {
server 100.64.2.118;
}
upstream bsky {
server 100.64.4.102:3000;
}
upstream freshrss {
server 192.168.1.219:8080;
keepalive 64;
}
upstream gitea {
server 192.168.1.215:3000;
}
upstream grafana {
server 192.168.1.200:3000;
}
upstream vaultwarden-default {
zone vaultwarden-default 64k;
server 192.168.1.209:8000;
keepalive 2;
}