server { include listen01_80; server_name psy.wiki www.psy.wiki; root /srv/www/parking/psy; index index.html; } server { include listen01_80; server_name ~^(?[\w-]+)\.psy\.wiki$; return 302 'https://psychonautwiki.org/wiki/?search=$subdomain'; } server { include listen01_443; server_name psy.wiki www.psy.wiki; ssl_certificate /etc/ssl/drugs/fullchain.pem; ssl_certificate_key /etc/ssl/drugs/private/privkey.pem; root /srv/www/parking/psy; index index.html; } server { include listen01_443; server_name ~^(?[\w-]+)\.psy\.wiki$; ssl_certificate /etc/ssl/drugs/fullchain.pem; ssl_certificate_key /etc/ssl/drugs/private/privkey.pem; return 302 'https://psychonautwiki.org/wiki/?search=$subdomain'; }