From 7c570934e43ccc5bcbbe566c2b0b3a22c17e4554 Mon Sep 17 00:00:00 2001 From: Benjamin Dauvergne Date: Fri, 11 May 2018 12:32:59 +0200 Subject: [PATCH] hautes-alpes: ajout configuration wildcard-collectivites.* --- ...ectivites.hautes-alpes.test.entrouvert.org | 62 +++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 hautes-alpes/wildcard-collectivites.hautes-alpes.test.entrouvert.org diff --git a/hautes-alpes/wildcard-collectivites.hautes-alpes.test.entrouvert.org b/hautes-alpes/wildcard-collectivites.hautes-alpes.test.entrouvert.org new file mode 100644 index 0000000..d68cdfb --- /dev/null +++ b/hautes-alpes/wildcard-collectivites.hautes-alpes.test.entrouvert.org @@ -0,0 +1,62 @@ +server { + listen 443 ssl; + server_name ~^(?.+)\.collectivites-hautes-alpes-test\.entrouvert\.org$; + + include includes/ssl.conf; + include includes/wildcard.test.entrouvert.org.conf; + + + access_log /var/log/nginx/wildcard-collectivites-hautes-alpes-test.entrouvert.org-access.log combined_full; + error_log /var/log/nginx/wildcard-collectivites-hautes-alpes-test.entrouvert.org-error.log; + + + location ~ ^/static/(.+)$ { + root /; + try_files /var/lib/combo/tenants/portail-usager-hautes-alpes.test.entrouvert.org/static/$1 + /var/lib/combo/tenants/portail-usager-hautes-alpes.test.entrouvert.org/theme/static/$1 + /var/lib/combo/collectstatic/$1 + =404; + add_header Access-Control-Allow-Origin *; + } + + + location ~ ^/media/(.+)$ { + alias /var/lib/combo/tenants/portail-usager-hautes-alpes.test.entrouvert.org/media/$1; + } + + location /robots.txt { + alias /var/lib/combo/www/robots.txt; + } + + location ~ ^/$ { + proxy_pass http://unix:/var/run/combo/combo.sock:/$ville/; + proxy_set_header Host portail-usager-hautes-alpes.test.entrouvert.org; + proxy_set_header X-Forwarded-SSL on; + proxy_set_header X-Forwarded-Protocol ssl; + proxy_set_header X-Forwarded-Proto https; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + } + + location / { + proxy_pass http://unix:/var/run/combo/combo.sock:/; + proxy_set_header Host portail-usager-hautes-alpes.test.entrouvert.org; + proxy_set_header X-Forwarded-SSL on; + proxy_set_header X-Forwarded-Protocol ssl; + proxy_set_header X-Forwarded-Proto https; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + } + +} + +server { + listen 80; + server_name *.collectivites-hautes-alpes-test.entrouvert.org; + + access_log /var/log/nginx/wildcard-collectivites-hautes-alpes-test.entrouvert.org-access.log combined_full; + error_log /var/log/nginx/wildcard-collectivites-hautes-alpes-test.entrouvert.org-error.log; + + return 302 https://$host$request_uri; +} +