Skip to content

Instantly share code, notes, and snippets.

@Code-Quake
Last active September 10, 2024 18:13
Show Gist options
  • Save Code-Quake/5c7b5f6dec43b6e022110a6776c28536 to your computer and use it in GitHub Desktop.
Save Code-Quake/5c7b5f6dec43b6e022110a6776c28536 to your computer and use it in GitHub Desktop.
NGINX Configuration
# ------------------------------------------------------------
# codequake.tplinkdns.com
# ------------------------------------------------------------
map $scheme $hsts_header {
https "max-age=63072000; preload";
}
server {
set $forward_scheme http;
set $server "127.0.0.1";
set $port 80;
listen 80;
listen [::]:80;
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name codequake.tplinkdns.com;
# Custom SSL
ssl_certificate /data/custom_ssl/npm-2/fullchain.pem;
ssl_certificate_key /data/custom_ssl/npm-2/privkey.pem;
# Block Exploits
include conf.d/include/block-exploits.conf;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $http_connection;
proxy_http_version 1.1;
access_log /data/logs/proxy-host-4_access.log proxy;
error_log /data/logs/proxy-host-4_error.log warn;
location /vw {
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Scheme $scheme;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Real-IP $remote_addr;
proxy_pass http://vaultwarden:80;
# Block Exploits
include conf.d/include/block-exploits.conf;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $http_connection;
proxy_http_version 1.1;
}
location /calibre {
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Scheme $scheme;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Real-IP $remote_addr;
proxy_pass http://calibre-web:8083;
proxy_set_header X-Forwarded-Host $server_name;
proxy_set_header X-Scheme $scheme;
proxy_set_header X-Script-Name /calibre;
# Block Exploits
include conf.d/include/block-exploits.conf;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $http_connection;
proxy_http_version 1.1;
}
location /joplinServer {
proxy_set_header X-Forwarded-Host $host;
proxy_redirect off;
rewrite ^/joplinServer/(.*)$ /$1 break;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Scheme $scheme;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Real-IP $remote_addr;
proxy_pass http://joplinsync:22300;
# Block Exploits
include conf.d/include/block-exploits.conf;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $http_connection;
proxy_http_version 1.1;
}
location / {
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $http_connection;
proxy_http_version 1.1;
# Proxy!
include conf.d/include/proxy.conf;
}
# Custom
include /data/nginx/custom/server_proxy[.]conf;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment