2019-10-27 22:13:40 +01:00
|
|
|
|
|
|
|
# worker_processes 1;
|
|
|
|
daemon off;
|
|
|
|
|
2019-11-02 22:41:29 +01:00
|
|
|
pid {{ service.root }}/pid;
|
|
|
|
|
2019-10-27 22:13:40 +01:00
|
|
|
worker_rlimit_nofile 1024;
|
|
|
|
events {
|
|
|
|
worker_connections 800;
|
|
|
|
}
|
|
|
|
|
|
|
|
http {
|
2019-11-17 20:06:42 +01:00
|
|
|
error_log {{ service.root }}/error.log warn;
|
|
|
|
access_log {{ service.root }}/access.log;
|
2019-10-27 22:13:40 +01:00
|
|
|
|
|
|
|
include /etc/nginx/mime.types;
|
|
|
|
default_type application/octet-stream;
|
|
|
|
index index.html index.htm index.xhtml;
|
|
|
|
|
|
|
|
fastcgi_param HTTP_PROXY "";
|
|
|
|
|
|
|
|
keepalive_timeout 65;
|
|
|
|
|
|
|
|
server_tokens off;
|
|
|
|
|
2019-11-02 22:14:08 +01:00
|
|
|
{% for user in consumers.www %}
|
2019-10-27 22:13:40 +01:00
|
|
|
server {
|
2019-11-02 22:14:08 +01:00
|
|
|
listen {{ service.ports.http }} ;
|
|
|
|
listen [::]:{{ service.ports.http }} ;
|
2019-10-27 22:13:40 +01:00
|
|
|
server_name {{ user.domain }} ;
|
|
|
|
|
|
|
|
location / {
|
|
|
|
root {{ user.root }} ;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
{% endfor %}
|
|
|
|
|
2019-11-02 22:14:08 +01:00
|
|
|
{% for user in consumers.http %}
|
2019-10-28 18:10:50 +01:00
|
|
|
server {
|
2019-11-02 22:14:08 +01:00
|
|
|
listen {{ service.ports.http }};
|
|
|
|
listen [::]:{{ service.ports.http }};
|
2019-10-28 18:10:50 +01:00
|
|
|
server_name {{ user.domain }} *.{{ user.domain }};
|
|
|
|
|
|
|
|
location / {
|
|
|
|
proxy_set_header Host $host;
|
|
|
|
proxy_next_upstream_timeout 2s;
|
2019-11-02 22:14:08 +01:00
|
|
|
proxy_pass http://127.0.0.1:{{ user.ports.http }}/;
|
2019-10-28 18:10:50 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
{% endfor %}
|
|
|
|
|
2019-10-27 22:13:40 +01:00
|
|
|
}
|