File: //volume1/@appstore/WebStation/misc/VirtualHost-nginx.mustache
{{#port_info.nginx}}
server {
listen {{.}};
listen [::]:{{.}};
location / {
return 404;
}
}{{/port_info.nginx}}
{{#hosts}}
server {
{{#port.http}}
listen {{.}}{{^fqdn}} default_server{{/fqdn}};
listen [::]:{{.}}{{^fqdn}} default_server{{/fqdn}};
{{/port.http}}
{{#port.https}}
listen {{.}} ssl{{#https.http2}} http2{{/https.http2}}{{^fqdn}} default_server{{/fqdn}};
listen [::]:{{.}} ssl{{#https.http2}} http2{{/https.http2}}{{^fqdn}} default_server{{/fqdn}};
{{/port.https}}
{{#fqdn}}
server_name {{fqdn}};
{{/fqdn}}
{{^fqdn}}
server_name _;
{{/fqdn}}
{{> /var/packages/WebStation/target/misc/SSLProfile.mustache }}
{{#SSLProfile.hsts}}{{#fqdn}}
if ($server_port = "80") {
return 301 https://$server_name$request_uri;
}
{{/fqdn}}{{/SSLProfile.hsts}}
{{#nginx}}
root "{{root}}";
index {{#index}} {{.}} {{/index}};
{{> /var/packages/WebStation/target/misc/nginx_web_error_page}}
location ^~ /_webstation_/ {
alias /var/packages/WebStation/target/error_page/;
}
{{#php}}
location ~* \.(php[345]?|phtml)$ {
fastcgi_pass unix:/run/php-fpm/{{php_handler}}.sock;
{{#fqdn}}fastcgi_param HOST "{{fqdn}}";{{/fqdn}}
include fastcgi.conf;
}
{{/php}}
include /usr/local/etc/nginx/conf.d/{{uuid}}/user.conf*;
{{/nginx}}
{{#apache22}}
include proxy.conf;
location / {
proxy_pass http://{{listen}};
}
{{/apache22}}
{{#apache24}}
include proxy.conf;
location / {
proxy_pass http://{{listen}};
}
{{/apache24}}
}
{{/hosts}}