Domain setup and archive message

This commit is contained in:
Oleg Lavrovsky 2018-06-02 14:27:25 +02:00
parent 823e383ae3
commit 0626be3997
3 changed files with 56 additions and 42 deletions

View file

@ -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;

View file

@ -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;
}
}

View file

@ -0,0 +1,46 @@
<h3 class="archive-message">
You are browsing the archived version of this website.
<a href="https://public-health.ch">Go to new site</a>
</h3>
<style>
.archive-message {
padding: 2em;
background: red;
color: white;
position: fixed;
bottom: 0px;
display: block;
width: 100%;
left: 0px;
}
.archive-message a {
border-radius: 5px;
border: 0;
text-transform: uppercase;
font-family: Helvetica,Arial,sans-serif;
font-weight: 700;
padding: 12px 24px;
display: inline-block;
margin-bottom: 0;
font-weight: 400;
text-align: center;
vertical-align: middle;
touch-action: manipulation;
cursor: pointer;
background-image: none;
border: 1px solid transparent;
white-space: nowrap;
padding: 6px 12px;
font-size: 14px;
line-height: 1.42857;
border-radius: 0;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
text-decoration: none;
background: #fff;
border: 1px solid #1e0e33;
color: #1e0e33;
}
</style>