server { listen 80; listen [::]:80; server_name element.envs.net; location / { return 302 https://$host$request_uri; } location /.well-known/acme-challenge/ { alias /var/lib/letsencrypt/.well-known/acme-challenge/; } } server { listen 443 ssl http2; listen [::]:443 ssl http2; server_name element.envs.net; include snippets/ssl.conf; root /opt/Riot/resources/webapp/; index index.html; location = /index.html { add_header Cache-Control "no-cache"; } } #ALIAS server { listen 80; listen [::]:80; server_name riot.envs.net; location / { return 302 https://element.envs.net$request_uri; } location /.well-known/acme-challenge/ { alias /var/lib/letsencrypt/.well-known/acme-challenge/; } } server { listen 443 ssl http2; listen [::]:443 ssl http2; server_name riot.envs.net; include snippets/ssl.conf; return 302 https://element.envs.net$request_uri; }