2018-10-16 20:52:04 +02:00
|
|
|
user {{ nginx_main_template.user }};
|
|
|
|
worker_processes {{ nginx_main_template.worker_processes }};
|
2018-01-26 20:00:26 +01:00
|
|
|
|
2018-10-16 20:52:04 +02:00
|
|
|
error_log /var/log/nginx/error.log {{ nginx_main_template.error_level }};
|
2018-01-26 20:00:26 +01:00
|
|
|
pid /var/run/nginx.pid;
|
|
|
|
|
|
|
|
|
|
|
|
events {
|
2018-10-16 20:52:04 +02:00
|
|
|
worker_connections {{ nginx_main_template.worker_connections }};
|
2018-01-26 20:00:26 +01:00
|
|
|
}
|
|
|
|
|
2018-10-16 20:52:04 +02:00
|
|
|
{% if nginx_main_template.http_enable %}
|
2018-01-26 20:00:26 +01:00
|
|
|
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;
|
|
|
|
|
2018-10-16 20:52:04 +02:00
|
|
|
keepalive_timeout {{ nginx_main_template.http_settings.keepalive_timeout }};
|
2018-01-26 20:00:26 +01:00
|
|
|
|
|
|
|
#gzip on;
|
2018-10-16 20:52:04 +02:00
|
|
|
{% if nginx_main_template.http_settings.cache %}
|
|
|
|
proxy_cache_path /tmp/cache keys_zone=one:10m;
|
|
|
|
{% endif %}
|
|
|
|
{% if nginx_main_template.http_settings.rate_limit %}
|
|
|
|
limit_req_zone $binary_remote_addr zone=mylimit:10m rate=10r/s;
|
|
|
|
{% endif %}
|
|
|
|
{% if nginx_main_template.http_settings.keyval %}
|
|
|
|
keyval_zone zone={{nginx_main_template.http_settings.keyval.zone}}:32k state=one.keyval;
|
|
|
|
keyval $arg_text $text zone=one;
|
2018-11-26 20:06:46 +01:00
|
|
|
{% endif %}
|
|
|
|
{% if nginx_main_template.http_global_autoindex %}
|
|
|
|
autoindex on;
|
2018-10-16 20:52:04 +02:00
|
|
|
{% endif %}
|
|
|
|
include /etc/nginx/conf.d/*.conf;
|
2018-02-20 21:28:14 +01:00
|
|
|
}
|
|
|
|
{% endif %}
|
|
|
|
|
2018-10-16 20:52:04 +02:00
|
|
|
{% if nginx_main_template.stream_enable %}
|
2018-02-20 21:28:14 +01:00
|
|
|
stream {
|
|
|
|
include /etc/nginx/conf.d/stream/*.conf;
|
2018-01-26 20:00:26 +01:00
|
|
|
}
|
2018-02-20 21:28:14 +01:00
|
|
|
{% endif %}
|