xoxys.nginx/templates/etc/nginx/nginx.conf.j2

67 lines
2.0 KiB
Plaintext
Raw Normal View History

#jinja2: lstrip_blocks: True
2017-07-15 15:24:48 +00:00
# {{ ansible_managed }}
2017-12-24 13:05:27 +00:00
user {{ nginx_user }} {{ nginx_group }};
2017-12-24 16:36:43 +00:00
worker_processes {{ nginx_worker_processes }};
2017-07-15 15:24:48 +00:00
2018-12-01 22:23:43 +00:00
pid /var/run/nginx.pid;
2017-07-15 15:24:48 +00:00
events {
2018-08-09 19:20:06 +00:00
worker_connections {{ nginx_worker_connections }};
2017-07-15 15:24:48 +00:00
}
http {
2018-08-09 19:20:06 +00:00
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"';
{% if nginx_error_log.enabled %}
2018-08-11 12:59:43 +00:00
error_log {{ nginx_error_log.file }} {{ nginx_error_log.level }};
{% else %}
error_log off;
{% endif %}
{% if nginx_access_log.enabled %}
2018-08-11 13:27:27 +00:00
access_log {{ nginx_access_log.file }} {{ nginx_access_log.format }};
2018-08-11 12:59:43 +00:00
{% else %}
access_log off;
{% endif %}
2018-08-09 19:20:06 +00:00
sendfile on;
tcp_nopush on;
tcp_nodelay on;
types_hash_max_size 2048;
server_tokens off;
## Buffers
2018-08-11 12:59:43 +00:00
client_body_buffer_size {{ nginx_client_body_buffer_size }};
client_header_buffer_size {{ nginx_client_header_buffer_size }};
client_max_body_size {{ nginx_client_max_body_size }};
2018-08-09 19:20:06 +00:00
## Timeouts
2018-08-11 12:59:43 +00:00
client_body_timeout {{ nginx_client_body_timeout }};
client_header_timeout {{ nginx_client_header_timeout }};
keepalive_timeout {{ nginx_keepalive_timeout }};
send_timeout {{ nginx_send_timeout }};
{% if nginx_reset_timedout_connection %}
reset_timedout_connection on;
{% endif %}
2018-08-09 19:20:06 +00:00
## Gzip Settings
2018-08-11 12:59:43 +00:00
{% if nginx_gzip_enabled %}
gzip on;
gzip_comp_level {{ nginx_gzip_comp_level }};
gzip_min_length {{ nginx_gzip_min_length }};
gzip_proxied {{ nginx_gzip_proxied | join(" ") }};
gzip_types {{ nginx_gzip_types | join(" ") }};
{% endif %}
# Load modular configuration files from the /etc/nginx/conf.d directory
2018-08-09 19:20:06 +00:00
include /etc/nginx/conf.d/*.conf;
## Virtual Host Configs
include /etc/nginx/sites-enabled/*;
2018-08-11 12:59:43 +00:00
server_names_hash_bucket_size {{ nginx_server_names_hash_bucket_size }};
2017-07-15 15:24:48 +00:00
}