set the correct header to satisfy qbit csrf check

This commit is contained in:
aptalca 2022-10-25 13:11:06 -04:00
parent 0548fd27ff
commit 539fd19f9e
2 changed files with 16 additions and 2 deletions

View file

@ -1,4 +1,4 @@
## Version 2022/09/08 ## Version 2022/10/25
# make sure that your dns has a cname set for qbittorrent and that your qbittorrent container is not using a base url # make sure that your dns has a cname set for qbittorrent and that your qbittorrent container is not using a base url
server { server {
@ -37,6 +37,7 @@ server {
proxy_set_header Referer ''; proxy_set_header Referer '';
proxy_set_header Host $upstream_app:$upstream_port; proxy_set_header Host $upstream_app:$upstream_port;
proxy_set_header X-Forwarded-Host $host;
} }
location ~ (/qbittorrent)?/api { location ~ (/qbittorrent)?/api {
@ -51,6 +52,7 @@ server {
proxy_set_header Referer ''; proxy_set_header Referer '';
proxy_set_header Host $upstream_app:$upstream_port; proxy_set_header Host $upstream_app:$upstream_port;
proxy_set_header X-Forwarded-Host $host;
} }
location ~ (/qbittorrent)?/command { location ~ (/qbittorrent)?/command {
@ -65,6 +67,7 @@ server {
proxy_set_header Referer ''; proxy_set_header Referer '';
proxy_set_header Host $upstream_app:$upstream_port; proxy_set_header Host $upstream_app:$upstream_port;
proxy_set_header X-Forwarded-Host $host;
} }
location ~ (/qbittorrent)?/query { location ~ (/qbittorrent)?/query {
@ -79,6 +82,7 @@ server {
proxy_set_header Referer ''; proxy_set_header Referer '';
proxy_set_header Host $upstream_app:$upstream_port; proxy_set_header Host $upstream_app:$upstream_port;
proxy_set_header X-Forwarded-Host $host;
} }
location ~ (/qbittorrent)?/login { location ~ (/qbittorrent)?/login {
@ -93,6 +97,7 @@ server {
proxy_set_header Referer ''; proxy_set_header Referer '';
proxy_set_header Host $upstream_app:$upstream_port; proxy_set_header Host $upstream_app:$upstream_port;
proxy_set_header X-Forwarded-Host $host;
} }
location ~ (/qbittorrent)?/sync { location ~ (/qbittorrent)?/sync {
@ -107,6 +112,7 @@ server {
proxy_set_header Referer ''; proxy_set_header Referer '';
proxy_set_header Host $upstream_app:$upstream_port; proxy_set_header Host $upstream_app:$upstream_port;
proxy_set_header X-Forwarded-Host $host;
} }
location ~ (/qbittorrent)?/scripts { location ~ (/qbittorrent)?/scripts {
@ -121,5 +127,6 @@ server {
proxy_set_header Referer ''; proxy_set_header Referer '';
proxy_set_header Host $upstream_app:$upstream_port; proxy_set_header Host $upstream_app:$upstream_port;
proxy_set_header X-Forwarded-Host $host;
} }
} }

View file

@ -1,4 +1,4 @@
## Version 2022/09/08 ## Version 2022/10/25
# qbittorrent does not require a base url setting # qbittorrent does not require a base url setting
location /qbittorrent { location /qbittorrent {
@ -27,6 +27,7 @@ location ^~ /qbittorrent/ {
proxy_set_header Referer ''; proxy_set_header Referer '';
proxy_set_header Host $upstream_app:$upstream_port; proxy_set_header Host $upstream_app:$upstream_port;
proxy_set_header X-Forwarded-Host $host;
} }
location ^~ /qbittorrent/api { location ^~ /qbittorrent/api {
@ -41,6 +42,7 @@ location ^~ /qbittorrent/api {
proxy_set_header Referer ''; proxy_set_header Referer '';
proxy_set_header Host $upstream_app:$upstream_port; proxy_set_header Host $upstream_app:$upstream_port;
proxy_set_header X-Forwarded-Host $host;
} }
location ^~ /qbittorrent/command { location ^~ /qbittorrent/command {
@ -55,6 +57,7 @@ location ^~ /qbittorrent/command {
proxy_set_header Referer ''; proxy_set_header Referer '';
proxy_set_header Host $upstream_app:$upstream_port; proxy_set_header Host $upstream_app:$upstream_port;
proxy_set_header X-Forwarded-Host $host;
} }
location ^~ /qbittorrent/query { location ^~ /qbittorrent/query {
@ -69,6 +72,7 @@ location ^~ /qbittorrent/query {
proxy_set_header Referer ''; proxy_set_header Referer '';
proxy_set_header Host $upstream_app:$upstream_port; proxy_set_header Host $upstream_app:$upstream_port;
proxy_set_header X-Forwarded-Host $host;
} }
location ^~ /qbittorrent/login { location ^~ /qbittorrent/login {
@ -83,6 +87,7 @@ location ^~ /qbittorrent/login {
proxy_set_header Referer ''; proxy_set_header Referer '';
proxy_set_header Host $upstream_app:$upstream_port; proxy_set_header Host $upstream_app:$upstream_port;
proxy_set_header X-Forwarded-Host $host;
} }
location ^~ /qbittorrent/sync { location ^~ /qbittorrent/sync {
@ -97,6 +102,7 @@ location ^~ /qbittorrent/sync {
proxy_set_header Referer ''; proxy_set_header Referer '';
proxy_set_header Host $upstream_app:$upstream_port; proxy_set_header Host $upstream_app:$upstream_port;
proxy_set_header X-Forwarded-Host $host;
} }
location ^~ /qbittorrent/scripts { location ^~ /qbittorrent/scripts {
@ -111,4 +117,5 @@ location ^~ /qbittorrent/scripts {
proxy_set_header Referer ''; proxy_set_header Referer '';
proxy_set_header Host $upstream_app:$upstream_port; proxy_set_header Host $upstream_app:$upstream_port;
proxy_set_header X-Forwarded-Host $host;
} }