1
0
mirror of https://github.com/xuthus83/pigallery2.git synced 2024-11-03 21:04:03 +08:00

Restricting non get methods to the /pgapi subdomain in the recommended nginx config #214, #519

This commit is contained in:
Patrik J. Braun 2022-12-10 00:57:31 +01:00
parent 3ac0bb22b2
commit 534f7187c4
2 changed files with 28 additions and 2 deletions

View File

@ -56,7 +56,9 @@ http {
gzip on;
location / {
# Only allow all methods (GET,POST,PUT,etc..) for root (/pgapi).
# see https://github.com/bpatrik/pigallery2/issues/214
location /pgapi {
proxy_pass http://pigallery2:80; # forwarding to the other container, named 'pigallery2'
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
@ -65,6 +67,17 @@ http {
proxy_cache_bypass $http_upgrade;
}
location / {
limit_except GET {
deny all;
}
proxy_pass http://pigallery2:80; # forwarding to the other container, named 'pigallery2'
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
listen 443 ssl default_server;
listen [::]:443 ssl default_server;

View File

@ -56,7 +56,9 @@ http {
gzip on;
location / {
# Only allow all methods (GET,POST,PUT,etc..) for root (/pgapi).
# see https://github.com/bpatrik/pigallery2/issues/214
location /pgapi {
proxy_pass http://pigallery2:80; # forwarding to the other container, named 'pigallery2'
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
@ -65,6 +67,17 @@ http {
proxy_cache_bypass $http_upgrade;
}
location / {
limit_except GET {
deny all;
}
proxy_pass http://pigallery2:80; # forwarding to the other container, named 'pigallery2'
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
listen 443 ssl default_server;
listen [::]:443 ssl default_server;