introduce proxy_options snippet

This commit is contained in:
6543 2021-01-23 00:31:55 +01:00
parent 476cc11b68
commit 98576f69e1
Signed by: 6543
GPG Key ID: C99B82E40B027BAE
3 changed files with 9 additions and 20 deletions

View File

@ -11,8 +11,6 @@ server {
ssl_certificate_key /etc/letsencrypt/live/my.domain.com/privkey.pem;
include /etc/nginx/snippets/ssl_options.conf;

# Configure maximum picture size
# Note that Diaspora has a client side check set at 4M
client_max_body_size 5M;
client_body_buffer_size 256K;

@ -21,16 +19,6 @@ server {

location / {
proxy_pass http://192.168.2.1/;
proxy_cache_use_stale error timeout http_500 http_502 http_503 http_504;

proxy_buffering on;
proxy_buffers 12 12k;
proxy_redirect off;

proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Proto https;
proxy_set_header X-Forwarded-Port 443;
proxy_set_header Host $host;
include /etc/nginx/snippets/proxy_options.conf;
}
}

View File

@ -21,12 +21,6 @@ server {

location / {
proxy_pass http://192.168.2.2/;
proxy_cache_use_stale error timeout http_500 http_502 http_503 http_504;

proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_redirect off;
include /etc/nginx/snippets/proxy_options.conf;
}
}

View File

@ -0,0 +1,7 @@
proxy_cache_use_stale error timeout http_500 http_502 http_503 http_504;

proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Proto https;
proxy_set_header X-Forwarded-Port 443;
proxy_set_header Host $host;