diff --git a/pillar/paas/docker.sls b/pillar/paas/docker.sls --- a/pillar/paas/docker.sls +++ b/pillar/paas/docker.sls @@ -381,6 +381,11 @@ app_port: 9090 host: xmpp.nasqueron.org + # Other subservices for XMPP + # listening to their own subdomain + aliases: + - conference.nasqueron.org + # Pixelfed pixelfed: pixelfed: diff --git a/roles/paas-docker/nginx/files/vhosts/openfire.conf b/roles/paas-docker/nginx/files/vhosts/openfire.conf --- a/roles/paas-docker/nginx/files/vhosts/openfire.conf +++ b/roles/paas-docker/nginx/files/vhosts/openfire.conf @@ -13,6 +13,10 @@ # and will be lost if the state is redeployed. # +# ------------------------------------------------------------- +# Application - {{ fqdn }} +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + server { listen 80; listen [::]:80; @@ -41,3 +45,24 @@ error_page 502 /502.html; location /502.html {} } + +{%- if aliases %} + +# ------------------------------------------------------------- +# Redirects for app aliases domains +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +server { + listen 80; + listen [::]:80; + server_name {{ aliases }}; + + include includes/tls; + ssl_certificate /srv/letsencrypt/etc/live/{{ fqdn }}/fullchain.pem; + ssl_certificate_key /srv/letsencrypt/etc/live/{{ fqdn }}/privkey.pem; + + include includes/letsencrypt; + + return 301 https://{{ fqdn }}$request_uri; +} +{%- endif %}