From bf70c591b4736d6ee66be9944c6af0d7a1ec6615 Mon Sep 17 00:00:00 2001 From: root Date: Thu, 29 Mar 2018 16:23:48 +0200 Subject: [PATCH] Simplify proxy pass --- fachschaften.at/crawler.conf | 3 +-- fachschaften.at/default.conf | 3 +-- fet.at/cloud.conf | 3 +-- fet.at/default.conf | 6 ++---- fet.at/git.conf | 1 + triton.fet.at/onetufree.conf | 5 +---- triton.fet.at/sql.triton.fet.at.conf | 4 +--- triton.fet.at/testrby.conf | 9 +++------ triton.fet.at/testrbyandi.conf | 9 +++------ triton.fet.at/wp2.conf | 6 +----- 10 files changed, 15 insertions(+), 34 deletions(-) diff --git a/fachschaften.at/crawler.conf b/fachschaften.at/crawler.conf index 52a6753..11a960e 100644 --- a/fachschaften.at/crawler.conf +++ b/fachschaften.at/crawler.conf @@ -34,8 +34,7 @@ server { } location @crawler { proxy_pass http://fachschaften:8080; - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; + include snippets/proxy_header.conf; } } diff --git a/fachschaften.at/default.conf b/fachschaften.at/default.conf index 7bdfeac..c7227bb 100644 --- a/fachschaften.at/default.conf +++ b/fachschaften.at/default.conf @@ -25,7 +25,6 @@ server { } location / { proxy_pass http://fachschaften.local:3000; - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; + include snippets/proxy_header.conf; } } diff --git a/fet.at/cloud.conf b/fet.at/cloud.conf index cd0c773..55570ff 100644 --- a/fet.at/cloud.conf +++ b/fet.at/cloud.conf @@ -25,8 +25,7 @@ server { index index.php; location / { proxy_pass http://192.168.95.22; - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; + include snippets/proxy_header.conf; proxy_buffering off; proxy_request_buffering off; client_body_buffer_size 32K; diff --git a/fet.at/default.conf b/fet.at/default.conf index a453e5e..2e6fe77 100644 --- a/fet.at/default.conf +++ b/fet.at/default.conf @@ -30,8 +30,7 @@ server { location /etherpad { proxy_pass http://192.168.95.11:3333; - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; + include snippets/proxy_header.conf; } } @@ -50,8 +49,7 @@ server { location / { proxy_pass http://192.168.95.11:3333; - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; + include snippets/proxy_header.conf; } location ~ ^/(alt|twiki) { return 302 https://www.alt.fet.at$request_uri; diff --git a/fet.at/git.conf b/fet.at/git.conf index 3e97a9f..ada73e7 100644 --- a/fet.at/git.conf +++ b/fet.at/git.conf @@ -19,5 +19,6 @@ server { location / { proxy_pass http://zyklon:3000; + include snippets/proxy_header.conf; } } diff --git a/triton.fet.at/onetufree.conf b/triton.fet.at/onetufree.conf index edd54ac..41485e7 100644 --- a/triton.fet.at/onetufree.conf +++ b/triton.fet.at/onetufree.conf @@ -55,11 +55,8 @@ server { # rewrite ^/wp/(.*)$ /$1 break; # return 301 http://$host$request_uri; proxy_pass http://triamp; + include snippets/proxy_header.conf; proxy_set_header Accept-Encoding ""; - proxy_set_header Host www.onetufree.at; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X_FORWARDED_SSL on; - proxy_set_header HTTP_X_FORWARDED_SSL on; proxy_redirect default; # more_set_headers 'Link: ; rel="https://api.w.org/", ; rel=shortlink' diff --git a/triton.fet.at/sql.triton.fet.at.conf b/triton.fet.at/sql.triton.fet.at.conf index 1d9f807..dcac01f 100644 --- a/triton.fet.at/sql.triton.fet.at.conf +++ b/triton.fet.at/sql.triton.fet.at.conf @@ -23,10 +23,8 @@ server { location / { proxy_pass http://triampsql; + include snippets/proxy_header.conf; proxy_set_header Accept-Encoding ""; - proxy_set_header Host sql.triton.fet.at; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X_FORWARDED_SSL on; proxy_redirect default; # force https Links diff --git a/triton.fet.at/testrby.conf b/triton.fet.at/testrby.conf index bcae3fc..eddd5b7 100644 --- a/triton.fet.at/testrby.conf +++ b/triton.fet.at/testrby.conf @@ -40,19 +40,16 @@ server { location / { proxy_pass http://mogok.local:3001; - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; + include snippets/proxy_header.conf; } location /tc { rewrite ^/tc/(.*)$ /$1 break; proxy_pass http://triton-amp.local:8080; - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; + include snippets/proxy_header.conf; } location /conf { rewrite ^/conf/(.*)$ /$1 break; proxy_pass http://mogok.local:8001; - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; + include snippets/proxy_header.conf; } } diff --git a/triton.fet.at/testrbyandi.conf b/triton.fet.at/testrbyandi.conf index 6e542cb..6b7ab89 100644 --- a/triton.fet.at/testrbyandi.conf +++ b/triton.fet.at/testrbyandi.conf @@ -40,19 +40,16 @@ server { location / { proxy_pass http://mogok.local:3002; - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; + include snippets/proxy_header.conf; } location /tc { rewrite ^/tc/(.*)$ /$1 break; proxy_pass http://triton-amp.local:8080; - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; + include snippets/proxy_header.conf; } location /conf { rewrite ^/conf/(.*)$ /$1 break; proxy_pass http://mogok.local:8001; - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; + include snippets/proxy_header.conf; } } diff --git a/triton.fet.at/wp2.conf b/triton.fet.at/wp2.conf index 3c52e22..b4555c1 100644 --- a/triton.fet.at/wp2.conf +++ b/triton.fet.at/wp2.conf @@ -29,12 +29,8 @@ server { # rewrite ^/wp/(.*)$ /$1 break; # return 301 http://$host$request_uri; proxy_pass http://triamp2; + include snippets/proxy_header.conf; proxy_set_header Accept-Encoding ""; - proxy_set_header Host wp2.triton.fet.at; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X_FORWARDED_SSL on; - proxy_set_header REQUEST_SCHEME https; - proxy_set_header HTTP_X_FORWARDED_SSL on; proxy_redirect default; # more_set_headers 'Link: ; rel="https://api.w.org/", ; rel=shortlink'