nginx/templates/nginx.conf.j2

84 lines
2.0 KiB
Plaintext
Raw Permalink Normal View History

2019-04-14 13:51:48 +00:00
user {{ nginx_user }};
error_log {{ nginx_error_log }};
#pid {{ nginx_pidfile }};
{% block worker %}
worker_processes {{ nginx_worker_processes }};
{% endblock %}
{% if nginx_extra_conf_options %}
{{ nginx_extra_conf_options }}
{% endif %}
{% block events %}
events {
worker_connections {{ nginx_worker_connections }};
multi_accept {{ nginx_multi_accept }};
}
{% endblock %}
http {
{% block http_begin %}{% endblock %}
{% block http_basic %}
include {{ nginx_mime_file_path }};
default_type application/octet-stream;
server_names_hash_bucket_size {{ nginx_server_names_hash_bucket_size }};
client_max_body_size {{ nginx_client_max_body_size }};
log_format main {{ nginx_log_format|indent(23) }};
access_log {{ nginx_access_log }};
sendfile {{ nginx_sendfile }};
tcp_nopush {{ nginx_tcp_nopush }};
tcp_nodelay {{ nginx_tcp_nodelay }};
keepalive_timeout {{ nginx_keepalive_timeout }};
keepalive_requests {{ nginx_keepalive_requests }};
server_tokens {{ nginx_server_tokens }};
{% if nginx_proxy_cache_path %}
proxy_cache_path {{ nginx_proxy_cache_path }};
{% endif %}
{% endblock %}
{% block http_gzip %}
# gzip on;
{% endblock %}
{% if nginx_extra_http_options %}
{{ nginx_extra_http_options|indent(4, False) }}
{% endif %}
2020-12-14 19:25:08 +00:00
{%if nginx_server_resolver %}
resolver {{nginx_server_resolver}};
{% endif %}
2019-04-14 13:51:48 +00:00
{% block http_upstream %}
{% for upstream in nginx_upstreams %}
upstream {{ upstream.name }} {
{% if upstream.strategy is defined %}
{{ upstream.strategy }};
{% endif %}
{% for server in upstream.servers %}
server {{ server }};
{% endfor %}
{% if upstream.keepalive is defined %}
keepalive {{ upstream.keepalive }};
{% endif %}
}
{% endfor %}
{% endblock %}
{% block http_includes %}
include {{ nginx_conf_path }}/*.conf;
{% if nginx_conf_path != nginx_vhost_path %}
2020-02-16 15:22:01 +00:00
include {{ nginx_vhost_path }}/*.conf;
2019-04-14 13:51:48 +00:00
{% endif %}
{% endblock %}
{% block http_end %}{% endblock %}
}