Temporarily support both beta.impress and impress
This commit is contained in:
parent
c85c3f5b8f
commit
f21a7da362
1 changed files with 36 additions and 0 deletions
|
@ -297,9 +297,45 @@
|
|||
- name: Set up certbot
|
||||
command: "certbot certonly --nginx -n --agree-tos --email {{ email_address }} --domains beta.impress.openneo.net"
|
||||
|
||||
# TODO: Remove the duplication once we've fully switched over hosts!
|
||||
# NOTE: I migrated over the certs manually, we'll want to have certbot
|
||||
# replace them once it's recognized as impress.openneo.net!
|
||||
- name: Add impress config file to nginx
|
||||
copy:
|
||||
content: |
|
||||
server {
|
||||
server_name impress.openneo.net;
|
||||
listen 80;
|
||||
if ($host = impress.openneo.net) {
|
||||
return 301 https://$host$request_uri;
|
||||
}
|
||||
}
|
||||
|
||||
server {
|
||||
server_name impress.openneo.net;
|
||||
listen 443 ssl;
|
||||
ssl_certificate /etc/letsencrypt/live/impress.openneo.net/fullchain.pem;
|
||||
ssl_certificate_key /etc/letsencrypt/live/impress.openneo.net/privkey.pem;
|
||||
include /etc/letsencrypt/options-ssl-nginx.conf;
|
||||
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
|
||||
ssl_session_cache shared:SSL:10m; # https://superuser.com/q/1484466/14127
|
||||
|
||||
root /srv/impress/current/public;
|
||||
|
||||
# Try serving static files first. If not found, fall back to the app.
|
||||
try_files $uri/index.html $uri @app;
|
||||
|
||||
location @app {
|
||||
proxy_pass http://127.0.0.1:3000;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto https;
|
||||
proxy_set_header X-Forwarded-Server $host;
|
||||
proxy_set_header Host $http_host;
|
||||
proxy_redirect off;
|
||||
}
|
||||
}
|
||||
|
||||
server {
|
||||
server_name {{ impress_hostname }};
|
||||
listen 80;
|
||||
|
|
Loading…
Reference in a new issue