From 0626be3997129df73a211a25f9115c8af165480c Mon Sep 17 00:00:00 2001 From: Oleg Lavrovsky Date: Sat, 2 Jun 2018 14:27:25 +0200 Subject: [PATCH] Domain setup and archive message --- ansible/roles/web/templates/nginx.conf.j2 | 8 ++-- .../web/templates/ph-extra-nginx.conf.j2 | 44 ++---------------- publichealth/static/org/archive-message.html | 46 +++++++++++++++++++ 3 files changed, 56 insertions(+), 42 deletions(-) create mode 100644 publichealth/static/org/archive-message.html diff --git a/ansible/roles/web/templates/nginx.conf.j2 b/ansible/roles/web/templates/nginx.conf.j2 index b624c50..9b390f3 100644 --- a/ansible/roles/web/templates/nginx.conf.j2 +++ b/ansible/roles/web/templates/nginx.conf.j2 @@ -1,12 +1,14 @@ #{{ ansible_managed }} +# Main site configuration for public-health.ch + upstream wagtail-site { server localhost:5000; } server { - listen [::]:80; - listen 80; - server_name {{ domain }}; + listen [::]:80 default_server; + listen 80 default_server; + server_name {{ domain }} sphc.ch; client_max_body_size 16M; diff --git a/ansible/roles/web/templates/ph-extra-nginx.conf.j2 b/ansible/roles/web/templates/ph-extra-nginx.conf.j2 index 36ccbdf..50b901d 100644 --- a/ansible/roles/web/templates/ph-extra-nginx.conf.j2 +++ b/ansible/roles/web/templates/ph-extra-nginx.conf.j2 @@ -1,6 +1,6 @@ #{{ ansible_managed }} -# Web archive and other special configurations for public-health.ch +# Web archive and other special configurations server { listen 80; @@ -10,9 +10,12 @@ server { location / { try_files $uri $uri/ =404; } + add_after_body /archive-message.html; + location = /archive-message.html { + root {{ release_dir }}/static/org/archive-message.html; + } } -# TODO: parameterize server { listen 80; server_name conference.{{ domain }}; @@ -23,40 +26,3 @@ server { return 301 $scheme://sph17.organizers-congress.org; } } - -# Conference site -server { - listen 80; - server_name sphc.ch www.sphc.ch; - - client_max_body_size 16M; - - gzip on; - gzip_types text/plain text/css application/x-javascript image/svg+xml; - gzip_comp_level 1; - gzip_disable msie6; - gzip_http_version 1.0; - gzip_proxied any; - gzip_vary on; - - location /static/ { - return 301 $scheme://public-health.ch$request_uri; - } - location /static/CACHE/ { - return 301 $scheme://public-health.ch$request_uri; - } - location /favicon.ico { - return 301 $scheme://public-health.ch$request_uri; - } - location /media/images { - return 301 $scheme://public-health.ch$request_uri; - } - - location / { - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header Host $http_host; - proxy_redirect off; - proxy_pass http://wagtail-site; - } -} diff --git a/publichealth/static/org/archive-message.html b/publichealth/static/org/archive-message.html new file mode 100644 index 0000000..12984a9 --- /dev/null +++ b/publichealth/static/org/archive-message.html @@ -0,0 +1,46 @@ +

+ You are browsing the archived version of this website. + Go to new site +

+