Cleanup redundant headers from proxy.conf

Also general cleanup of whitespace
This commit is contained in:
Eric Nemchik 2020-09-01 11:56:42 -05:00
parent 64499676be
commit 54ede40938
60 changed files with 79 additions and 133 deletions

View file

@ -3,6 +3,7 @@
location /adminer {
return 301 $scheme://$host/adminer/;
}
location ^~ /adminer/ {
# enable the next two lines for http auth
#auth_basic "Restricted";

View file

@ -35,8 +35,6 @@ server {
set $upstream_proto http;
proxy_pass $upstream_proto://$upstream_app:$upstream_port;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
}
location ~ (/bazarr)?/api {
@ -47,7 +45,5 @@ server {
set $upstream_proto http;
proxy_pass $upstream_proto://$upstream_app:$upstream_port;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
}
}

View file

@ -3,6 +3,7 @@
location /bazarr {
return 301 $scheme://$host/bazarr/;
}
location ^~ /bazarr/ {
# enable the next two lines for http auth
#auth_basic "Restricted";
@ -22,8 +23,6 @@ location ^~ /bazarr/ {
set $upstream_proto http;
proxy_pass $upstream_proto://$upstream_app:$upstream_port;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
}
location ^~ /bazarr/api {
@ -34,6 +33,4 @@ location ^~ /bazarr/api {
set $upstream_proto http;
proxy_pass $upstream_proto://$upstream_app:$upstream_port;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
}

View file

@ -19,8 +19,6 @@ location /beets {
set $upstream_proto http;
proxy_pass $upstream_proto://$upstream_app:$upstream_port;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Scheme $scheme;
proxy_set_header X-Script-Name /beets;
}

View file

@ -1,5 +1,6 @@
# make sure that your dns has a cname set for bitwarden and that your bitwarden container is not using a base url
# make sure your bitwarden container is named "bitwarden"
# set the environment variable WEBSOCKET_ENABLED=true on your bitwarden container
server {
listen 443 ssl;
@ -38,7 +39,18 @@ server {
}
location /notifications/hub {
location /admin {
# enable the next two lines for http auth
#auth_basic "Restricted";
#auth_basic_user_file /config/nginx/.htpasswd;
# enable the next two lines for ldap auth
#auth_request /auth;
#error_page 401 =200 /ldaplogin;
# enable for Authelia
#include /config/nginx/authelia-location.conf;
include /config/nginx/proxy.conf;
resolver 127.0.0.11 valid=30s;
set $upstream_app bitwarden;
@ -46,8 +58,16 @@ server {
set $upstream_proto http;
proxy_pass $upstream_proto://$upstream_app:$upstream_port;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
}
location /notifications/hub {
include /config/nginx/proxy.conf;
resolver 127.0.0.11 valid=30s;
set $upstream_app bitwarden;
set $upstream_port 3012;
set $upstream_proto http;
proxy_pass $upstream_proto://$upstream_app:$upstream_port;
}
location /notifications/hub/negotiate {
@ -59,5 +79,4 @@ server {
proxy_pass $upstream_proto://$upstream_app:$upstream_port;
}
}

View file

@ -3,6 +3,7 @@
location /calibre-web {
return 301 $scheme://$host/calibre-web/;
}
location ^~ /calibre-web/ {
# enable the next two lines for http auth
#auth_basic "Restricted";

View file

@ -35,7 +35,5 @@ server {
proxy_pass $upstream_proto://$upstream_app:$upstream_port;
proxy_buffering off;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $http_connection;
}
}

View file

@ -3,6 +3,7 @@
location /calibre {
return 301 $scheme://$host/calibre/;
}
location ^~ /calibre/ {
# enable the next two lines for http auth
#auth_basic "Restricted";

View file

@ -35,7 +35,5 @@ server {
set $upstream_proto http;
proxy_pass $upstream_proto://$upstream_app:$upstream_port;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection upgrade;
}
}

View file

@ -49,8 +49,6 @@ server {
set $upstream_proto https;
proxy_pass $upstream_proto://$upstream_app:$upstream_port;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header Host $http_host;
proxy_read_timeout 36000s;
}
@ -74,8 +72,6 @@ server {
set $upstream_proto https;
proxy_pass $upstream_proto://$upstream_app:$upstream_port;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header Host $http_host;
proxy_read_timeout 36000s;
}

View file

@ -3,6 +3,7 @@
location /deluge {
return 301 $scheme://$host/deluge/;
}
location ^~ /deluge/ {
# enable the next two lines for http auth
#auth_basic "Restricted";

View file

@ -36,8 +36,5 @@ server {
set $upstream_proto http;
proxy_pass $upstream_proto://$upstream_app:$upstream_port;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection upgrade;
}
}

View file

@ -3,6 +3,7 @@
location /dozzle {
return 301 $scheme://$host/dozzle/;
}
location ^~ /dozzle/ {
# enable the next two lines for http auth
#auth_basic "Restricted";

View file

@ -3,6 +3,7 @@
location /duplicati {
return 301 $scheme://$host/duplicati/;
}
location ^~ /duplicati/ {
# enable the next two lines for http auth
#auth_basic "Restricted";

View file

@ -25,8 +25,5 @@ server {
proxy_set_header Range $http_range;
proxy_set_header If-Range $http_if_range;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $http_connection;
}
}

View file

@ -8,6 +8,7 @@
location /emby {
return 301 $scheme://$host/emby/;
}
location ^~ /emby/ {
include /config/nginx/proxy.conf;
resolver 127.0.0.11 valid=30s;
@ -28,6 +29,4 @@ location ^~ /embywebsocket {
set $upstream_proto http;
proxy_pass $upstream_proto://$upstream_app:$upstream_port;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $http_connection;
}

View file

@ -3,6 +3,7 @@
location /flood {
return 301 $scheme://$host/flood/;
}
location ^~ /flood/ {
# enable the next two lines for http auth
#auth_basic "Restricted";

View file

@ -3,6 +3,7 @@
location /glances {
return 301 $scheme://$host/glances/;
}
location ^~ /glances/ {
# enable the next two lines for http auth
#auth_basic "Restricted";

View file

@ -34,7 +34,6 @@ server {
set $upstream_port 80;
set $upstream_proto http;
proxy_pass $upstream_proto://$upstream_app:$upstream_port;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
}

View file

@ -36,5 +36,4 @@ server {
proxy_pass $upstream_proto://$upstream_app:$upstream_port;
}
}

View file

@ -3,6 +3,7 @@
location /guacamole {
return 301 $scheme://$host/guacamole/;
}
location ^~ /guacamole/ {
# enable the next two lines for http auth
#auth_basic "Restricted";

View file

@ -44,10 +44,5 @@ server {
set $upstream_proto http;
proxy_pass $upstream_proto://$upstream_app:$upstream_port;
proxy_set_header Host $host;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
}

View file

@ -35,7 +35,5 @@ server {
set $upstream_proto http;
proxy_pass $upstream_proto://$upstream_app:$upstream_port;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $http_connection;
}
}

View file

@ -8,6 +8,7 @@
location /jellyfin {
return 301 $scheme://$host/jellyfin/;
}
location ^~ /jellyfin/ {
include /config/nginx/proxy.conf;
resolver 127.0.0.11 valid=30s;
@ -18,6 +19,4 @@ location ^~ /jellyfin/ {
proxy_set_header Range $http_range;
proxy_set_header If-Range $http_if_range;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $http_connection;
}

View file

@ -4,6 +4,7 @@
location /jenkins {
return 301 $scheme://$host/jenkins/;
}
location ^~ /jenkins/ {
# enable the next two lines for http auth
#auth_basic "Restricted";

View file

@ -3,6 +3,7 @@
location /kanzi {
return 301 $scheme://$host/kanzi/;
}
location ^~ /kanzi/ {
# enable the next two lines for http auth
#auth_basic "Restricted";

View file

@ -6,6 +6,7 @@
location /admin{
return 301 $scheme://$host/admin/;
}
location ^~ /admin/ {
# enable the next two lines for http auth
#auth_basic "Restricted";
@ -30,6 +31,7 @@ location ^~ /admin/ {
location /webmail{
return 301 $scheme://$host/webmail/;
}
location ^~ /webmail/ {
# enable the next two lines for http auth
#auth_basic "Restricted";

View file

@ -29,8 +29,6 @@ server {
#include /config/nginx/authelia-location.conf;
include /config/nginx/proxy.conf;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
resolver 127.0.0.11 valid=30s;
set $upstream_app medusa;
set $upstream_port 8081;

View file

@ -13,8 +13,6 @@ location ^~ /medusa {
#include /config/nginx/authelia-location.conf;
include /config/nginx/proxy.conf;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
resolver 127.0.0.11 valid=30s;
set $upstream_app medusa;
set $upstream_port 8081;

View file

@ -3,6 +3,7 @@
location /monitorr {
return 301 $scheme://$host/monitorr/;
}
location ^~ /monitorr/ {
# enable the next two lines for http auth
#auth_basic "Restricted";

View file

@ -4,6 +4,7 @@
location /todo {
return 301 $scheme://$host/todo/;
}
location ^~ /todo/ {
# enable the next two lines for http auth

View file

@ -34,5 +34,6 @@ server {
set $upstream_port 3000;
set $upstream_proto http;
proxy_pass $upstream_proto://$upstream_app:$upstream_port;
}
}

View file

@ -3,6 +3,7 @@
location /netdata {
return 301 $scheme://$host/netdata/;
}
location ^~ /netdata/ {
# enable the next two lines for http auth
#auth_basic "Restricted";

View file

@ -36,7 +36,6 @@ location ^~ /nextcloud/ {
proxy_set_header Range $http_range;
proxy_set_header If-Range $http_if_range;
proxy_set_header Connection $http_connection;
proxy_redirect off;
proxy_ssl_session_reuse off;
}

View file

@ -86,5 +86,4 @@ server {
proxy_pass $upstream_proto://$upstream_app:$upstream_port;
}
}

View file

@ -58,6 +58,7 @@ server {
proxy_pass $upstream_proto://$upstream_app:$upstream_port;
}
if ($http_referer ~* /ombi) {
rewrite ^/swagger/(.*) /ombi/swagger/$1? redirect;
}

View file

@ -35,6 +35,7 @@ location ^~ /ombi/api {
proxy_pass $upstream_proto://$upstream_app:$upstream_port;
}
if ($http_referer ~* /ombi) {
rewrite ^/api/(.*) /ombi/api/$1? redirect;
}
@ -49,6 +50,7 @@ location ^~ /ombi/swagger {
proxy_pass $upstream_proto://$upstream_app:$upstream_port;
}
if ($http_referer ~* /ombi) {
rewrite ^/swagger/(.*) /ombi/swagger/$1? redirect;
}

View file

@ -3,6 +3,7 @@
location /phpmyadmin {
return 301 $scheme://$host/phpmyadmin/;
}
location ^~ /phpmyadmin/ {
# enable the next two lines for http auth
#auth_basic "Restricted";

View file

@ -3,6 +3,7 @@
location /pihole {
return 301 $scheme://$host/pihole/;
}
location ^~ /pihole/ {
# enable the next two lines for http auth
#auth_basic "Restricted";
@ -29,6 +30,7 @@ location ^~ /pihole/ {
location /pihole/admin {
return 301 $scheme://$host/pihole/admin/;
}
location ^~ /pihole/admin/ {
# enable the next two lines for http auth
#auth_basic "Restricted";

View file

@ -40,9 +40,6 @@ server {
set $upstream_proto http;
proxy_pass $upstream_proto://$upstream_app:$upstream_port;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header X-Plex-Client-Identifier $http_x_plex_client_identifier;
proxy_set_header X-Plex-Device $http_x_plex_device;
proxy_set_header X-Plex-Device-Name $http_x_plex_device_name;

View file

@ -9,6 +9,7 @@
location /plex {
return 301 $scheme://$host/plex/;
}
location ^~ /plex/ {
# enable the next two lines for http auth
#auth_basic "Restricted";
@ -43,6 +44,7 @@ location ^~ /plex/ {
proxy_set_header X-Plex-Device-Vendor $http_x_plex_device_vendor;
proxy_set_header X-Plex-Model $http_x_plex_model;
}
if ($http_referer ~* /plex) {
rewrite ^/web/(.*) /plex/web/$1? redirect;
}

View file

@ -3,6 +3,7 @@
location /plexwebtools {
return 301 $scheme://$host/plexwebtools/;
}
location ^~ /plexwebtools/ {
# enable the next two lines for http auth
#auth_basic "Restricted";

View file

@ -35,8 +35,7 @@ server {
set $upstream_proto http;
proxy_pass $upstream_proto://$upstream_app:$upstream_port;
proxy_set_header Connection "";
proxy_hide_header X-Frame-Options; # Possibly nott needed after Portainer 1.20.0
proxy_hide_header X-Frame-Options; # Possibly not needed after Portainer 1.20.0
}
location /api/websocket/ {
@ -58,8 +57,6 @@ server {
set $upstream_proto http;
proxy_pass $upstream_proto://$upstream_app:$upstream_port;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_hide_header X-Frame-Options; # Possibly nott needed after Portainer 1.20.0
proxy_hide_header X-Frame-Options; # Possibly not needed after Portainer 1.20.0
}
}

View file

@ -3,6 +3,7 @@
location /portainer {
return 301 $scheme://$host/portainer/;
}
location ^~ /portainer/ {
# enable the next two lines for http auth
#auth_basic "Restricted";
@ -35,7 +36,5 @@ location ^~ /portainer/api/websocket/ {
proxy_pass $upstream_proto://$upstream_app:$upstream_port;
rewrite /portainer(.*) $1 break;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_hide_header X-Frame-Options; # Possibly nott needed after Portainer 1.20.0
proxy_hide_header X-Frame-Options; # Possibly not needed after Portainer 1.20.0
}

View file

@ -34,6 +34,7 @@ server {
set $upstream_port 8080;
set $upstream_proto https;
proxy_pass $upstream_proto://$upstream_app:$upstream_port;
}
location /ws {
@ -56,8 +57,5 @@ server {
proxy_pass $upstream_proto://$upstream_app:$upstream_port;
proxy_buffering off;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
}

View file

@ -3,6 +3,7 @@
location /qbittorrent {
return 301 $scheme://$host/qbittorrent/;
}
location ^~ /qbittorrent/ {
# enable the next two lines for http auth
#auth_basic "Restricted";

View file

@ -35,8 +35,6 @@ server {
set $upstream_proto http;
proxy_pass $upstream_proto://$upstream_app:$upstream_port;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $http_connection;
}
location ~ (/radarr)?/api {
@ -47,7 +45,5 @@ server {
set $upstream_proto http;
proxy_pass $upstream_proto://$upstream_app:$upstream_port;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $http_connection;
}
}

View file

@ -19,8 +19,6 @@ location ^~ /radarr {
set $upstream_proto http;
proxy_pass $upstream_proto://$upstream_app:$upstream_port;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $http_connection;
}
location ^~ /radarr/api {
@ -31,6 +29,4 @@ location ^~ /radarr/api {
set $upstream_proto http;
proxy_pass $upstream_proto://$upstream_app:$upstream_port;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $http_connection;
}

View file

@ -3,6 +3,7 @@
location /rutorrent {
return 301 $scheme://$host/rutorrent/;
}
location ^~ /rutorrent/ {
# enable the next two lines for http auth
#auth_basic "Restricted";

View file

@ -3,6 +3,7 @@
location /scope {
return 301 $scheme://$host/scope/;
}
location ^~ /scope/ {
# enable the next two lines for http auth
#auth_basic "Restricted";
@ -23,6 +24,4 @@ location ^~ /scope/ {
proxy_pass $upstream_proto://$upstream_app:$upstream_port;
rewrite /scope(.*) $1 break;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}

View file

@ -36,8 +36,6 @@ server {
proxy_pass $upstream_proto://$upstream_app:$upstream_port;
proxy_set_header Host $http_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;
}
}

View file

@ -20,8 +20,6 @@ location ^~ /sickchill {
proxy_pass $upstream_proto://$upstream_app:$upstream_port;
proxy_set_header Host $http_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;
}

View file

@ -40,8 +40,6 @@ server {
set $upstream_proto http;
proxy_pass $upstream_proto://$upstream_app:$upstream_port;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
###
@ -57,9 +55,6 @@ server {
set $upstream_proto http;
proxy_pass $upstream_proto://$upstream_app:$upstream_port;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
# Due to a bug in SyncLounge, some websockets calls don't respect the base url (server root) setting
@ -71,8 +66,5 @@ server {
set $upstream_proto http;
proxy_pass $upstream_proto://$upstream_app:$upstream_port/slserver/socket.io/;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
}

View file

@ -15,7 +15,6 @@
# }
#}
# Uncomment to force SyncLounge to always load over http. Only use this if you've allowed http per the above instructions.
#if ($scheme = https) {
# return 301 http://$host$request_uri;
@ -54,10 +53,8 @@ location /slweb {
proxy_pass $upstream_proto://$upstream_app:$upstream_port;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
if ($http_referer ~* /slweb) {
# Some requests like /config don't respect the base url (web root) setting
rewrite ^/config /slweb/config redirect;
@ -79,10 +76,8 @@ location /slserver {
proxy_pass $upstream_proto://$upstream_app:$upstream_port;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
if ($http_referer ~* /slserver) {
# Some requests like socket.io don't respect the base url (server root) setting
rewrite ^/socket.io/(.*) /slserver/socket.io/$1? redirect;

View file

@ -36,8 +36,5 @@ server {
proxy_pass $upstream_proto://$upstream_app:$upstream_port;
proxy_buffering off;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $http_connection;
}
}

View file

@ -3,6 +3,7 @@
location /thelounge {
return 301 $scheme://$host/thelounge/;
}
location ^~ /thelounge/ {
# enable the next two lines for http auth
#auth_basic "Restricted";

View file

@ -1,4 +1,6 @@
# make sure that your dns has a cname set for unifi and that your unifi-controller container is not using a base url
# NOTE: If you use the proxy_cookie_path setting in proxy.conf you need to remove HTTPOnly;
# ex: proxy_cookie_path / "/; Secure";
server {
listen 443 ssl;
@ -35,31 +37,6 @@ server {
set $upstream_proto https;
proxy_pass $upstream_proto://$upstream_app:$upstream_port;
}
location /wss {
# enable the next two lines for http auth
#auth_basic "Restricted";
#auth_basic_user_file /config/nginx/.htpasswd;
# enable the next two lines for ldap auth
#auth_request /auth;
#error_page 401 =200 /ldaplogin;
# enable for Authelia
#include /config/nginx/authelia-location.conf;
include /config/nginx/proxy.conf;
resolver 127.0.0.11 valid=30s;
set $upstream_app unifi-controller;
set $upstream_port 8443;
set $upstream_proto https;
proxy_pass $upstream_proto://$upstream_app:$upstream_port;
proxy_buffering off;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_ssl_verify off;
}
}

View file

@ -19,10 +19,9 @@ location ^~ /youtube-dl/ {
set $upstream_port 8080;
set $upstream_proto http;
proxy_pass $upstream_proto://$upstream_app:$upstream_port;
proxy_redirect off;
rewrite /youtube-dl(.*) $1 break;
proxy_set_header Referer '';
proxy_set_header Host $upstream_app:8080;
rewrite /youtube-dl(.*) $1 break;
}