42 lines
1.4 KiB
Django/Jinja
42 lines
1.4 KiB
Django/Jinja
user nginx;
|
|||
|
|
worker_processes auto;
|
||
|
|
error_log /var/log/nginx/error.log notice;
|
||
|
|
pid /run/nginx.pid;
|
||
|
|
events {
|
||
|
|
worker_connections 1024;
|
||
|
|
}
|
||
|
|
stream {
|
||
|
|
log_format proxy '$remote_addr [$time_local] $protocol $status $bytes_sent $bytes_received $session_time "$upstream_addr" "$ssl_preread_server_name"';
|
||
|
|
access_log /var/log/nginx/stream-access.log proxy;
|
||
|
|
map $ssl_preread_server_name $backend_name {
|
||
|
|
{% if telemt_host is defined %}
|
||
|
|
{{ telemt_host }} {{ telemt_host.split('.')[0] }}_backend;
|
||
|
|
{% endif %}
|
||
|
|
{% for item in dnsmasq %}
|
||
|
|
{{ item.name }} {{ item.name.split('.')[0] }}_backend;
|
||
|
|
{% endfor %}
|
||
|
|
default "";
|
||
|
|
}
|
||
|
|
{% if telemt_host is defined %}
|
||
|
|
upstream {{ telemt_host.split('.')[0] }}_backend { server 127.0.0.1:{{ telemt_backend_port }}; }
|
||
|
|
{% endif %}
|
||
|
|
{% for item in dnsmasq %}
|
||
|
|
upstream {{ item.name.split('.')[0] }}_backend { server 127.0.0.1:{{ item.backend_port }}; }
|
||
|
|
{% endfor %}
|
||
|
|
server {
|
||
|
|
listen 443;
|
||
|
|
ssl_preread on;
|
||
|
|
proxy_pass $backend_name;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
http {
|
||
|
|
include /etc/nginx/mime.types;
|
||
|
|
default_type application/octet-stream;
|
||
|
|
log_format main '$remote_addr - $remote_user [$time_local] "$request" $status $body_bytes_sent "$http_referer" "$http_user_agent" "$http_x_forwarded_for"';
|
||
|
|
access_log /var/log/nginx/access.log main;
|
||
|
|
sendfile on;
|
||
|
|
#tcp_nopush on;
|
||
|
|
keepalive_timeout 65;
|
||
|
|
#gzip on;
|
||
|
|
include /etc/nginx/conf.d/*.conf;
|
||
|
|
}
|