server { listen 80; server_name drop.bakatrouble.pw; location /_ { alias /srv/apps/drop/files; } location / { include uwsgi_params; uwsgi_pass unix:///tmp/drop.sock; } } server { listen 80; server_name ~^(?.*)\.drop\.bakatrouble\.pw$; location /_ { alias /srv/apps/drop/subdomain_files/$dir; } location / { include uwsgi_params; uwsgi_pass unix:///tmp/drop.sock; } }