ansible-role-nginx/templates/nginx.conf.j2

76 lines
1.5 KiB
Text
Raw Normal View History

# Managed by Ansible
user www-data;
worker_processes auto;
pid /run/nginx.pid;
include /etc/nginx/modules-enabled/*.conf;
events {
worker_connections 768;
multi_accept on;
}
http {
##
# Basic Settings
##
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
server_tokens off;
map_hash_max_size 4096;
map_hash_bucket_size 128;
server_names_hash_bucket_size 128;
client_max_body_size 0;
include /etc/nginx/mime.types;
default_type application/octet-stream;
##
# Logging Settings
##
log_format noip '0.0.0.0 - $remote_user [$time_local] '
'"$host" "$request" $status $body_bytes_sent '
'"$http_referer" "$http_user_agent" "$request_time" seconds';
#access_log /var/log/nginx/access.log noip if=$log_ip;
access_log off;
error_log /var/log/nginx/error.log;
##
# Gzip Settings
##
2023-03-11 20:52:04 +01:00
{% if nginx_gzip is defined and nginx_gzip %}
gzip on;
{% if nginx_type == 'gateway' %}
gzip_proxied any;
{% endif %}
gzip_static on;
gzip_http_version {{ nginx_http_version }};
gzip_disable "MSIE [1-6]\.";
gzip_vary on;
gzip_comp_level 6;
gzip_types
{% for type in nginx_gzip_types %}
{{ type }}
{% endfor %}
gzip_buffers 16 8k;
gzip_min_length 512;
{% else %}
gzip off;
2023-03-11 20:52:04 +01:00
{% endif %}
##
# Virtual Host Configs
##
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
}