46 lines
948 B
Plaintext
46 lines
948 B
Plaintext
|
|
worker_processes 1;
|
|
|
|
events {
|
|
worker_connections 1024;
|
|
}
|
|
|
|
http {
|
|
sendfile on;
|
|
gzip on;
|
|
default_type application/octet-stream;
|
|
resolver 127.0.0.1;
|
|
include /etc/nginx/mime.types;
|
|
|
|
server {
|
|
listen 80 default_server;
|
|
listen [::]:80 default_server;
|
|
server_name _;
|
|
return 301 https://$host$request_uri;
|
|
}
|
|
|
|
server {
|
|
listen 443 ssl;
|
|
ssl_certificate /config/nginx/cert.pem;
|
|
ssl_certificate_key /config/nginx/key.pem;
|
|
server_name {{host}};
|
|
autoindex off;
|
|
|
|
root /usr/share/nginx/html;
|
|
|
|
{{#services}}
|
|
location ~ ^/{{name}}(?:/(.*))?$ {
|
|
proxy_pass http://{{name}}:{{defaultPort}}/$1$is_args$args;
|
|
}
|
|
{{/services}}
|
|
|
|
location ~ ^/static(?:/(.*))?$ {
|
|
alias /usr/share/nginx/html/$1;
|
|
autoindex on;
|
|
}
|
|
location ~ ^(?:/(.*))?$ {
|
|
proxy_pass http://{{defaultService}}:{{defaultPort}}/$1$is_args$args;
|
|
}
|
|
}
|
|
}
|