28 lines
437 B
Text
28 lines
437 B
Text
map $host $subdomain {
|
|
~^(?P<sub>.+)\.{{ domain_segments|join("\\.") }}$ $sub;
|
|
}
|
|
|
|
server {
|
|
listen 80;
|
|
server_name *.{{ domain_segments|join(".") }};
|
|
|
|
root /var/www/repos/$subdomain;
|
|
|
|
location = / {
|
|
autoindex on;
|
|
}
|
|
|
|
location / {
|
|
try_files $uri $uri/ /index.html;
|
|
index index.html index.htm;
|
|
|
|
if (!-e $request_filename) {
|
|
return 404;
|
|
}
|
|
}
|
|
|
|
location ~ /\.git {
|
|
deny all;
|
|
return 404;
|
|
}
|
|
}
|