Domain setup

This commit is contained in:
Oleg Lavrovsky 2018-06-02 15:01:29 +02:00
parent b44e07b41c
commit 07a27d4385
2 changed files with 37 additions and 26 deletions

View file

@ -8,8 +8,24 @@ upstream wagtail-site {
server {
listen [::]:80 default_server;
listen 80 default_server;
server_name {{ domain }};
return 301 https://$server_name$request_uri;
}
server {
listen 80;
server_name sphc.ch;
return 301 https://$server_name$request_uri;
}
server {
listen [::]:443;
listen 443 ssl;
server_name {{ domain }} sphc.ch;
ssl on;
ssl_certificate /etc/letsencrypt/live/{{ domain }}/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/{{ domain }}/privkey.pem;
include /etc/letsencrypt/options-ssl-nginx.conf;
client_max_body_size 16M;
gzip on;
@ -57,17 +73,4 @@ server {
proxy_redirect off;
proxy_pass http://wagtail-site;
}
# Enable secure site support
listen [::]:443;
listen 443 ssl;
ssl on;
ssl_certificate /etc/letsencrypt/live/{{ domain }}/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/{{ domain }}/privkey.pem;
include /etc/letsencrypt/options-ssl-nginx.conf;
if ($scheme != "https") {
return 301 https://$host$request_uri;
}
}

View file

@ -5,6 +5,16 @@
server {
listen 80;
server_name www-old.{{ domain }};
return 301 https://$server_name$request_uri;
}
server {
listen 443 ssl;
server_name www-old.{{ domain }};
ssl on;
ssl_certificate /etc/letsencrypt/live/{{ domain }}/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/{{ domain }}/privkey.pem;
include /etc/letsencrypt/options-ssl-nginx.conf;
index index.html index.htm;
root {{ archive_dir }};
add_after_body /archive-message.html;
@ -14,33 +24,31 @@ server {
location / {
try_files $uri $uri/ =404;
}
# Enable secure site support
listen [::]:443;
listen 443 ssl;
ssl on;
ssl_certificate /etc/letsencrypt/live/{{ domain }}/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/{{ domain }}/privkey.pem;
include /etc/letsencrypt/options-ssl-nginx.conf;
if ($scheme != "https") {
return 301 https://$host$request_uri;
}
}
server {
listen 80;
server_name conference.{{ domain }};
location /fr {
return 301 $scheme://sph17.organizers-congress.org/frontend/index.php?sub=89;
}
location / {
return 301 $scheme://sph17.organizers-congress.org;
}
# Enable secure site support
listen [::]:443;
}
server {
listen 443 ssl;
server_name conference.{{ domain }};
ssl on;
ssl_certificate /etc/letsencrypt/live/{{ domain }}/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/{{ domain }}/privkey.pem;
include /etc/letsencrypt/options-ssl-nginx.conf;
location /fr {
return 301 $scheme://sph17.organizers-congress.org/frontend/index.php?sub=89;
}
location / {
return 301 $scheme://sph17.organizers-congress.org;
}
}