2023-03-11 18:18:27 +01:00
|
|
|
# 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;
|
2023-03-11 21:25:09 +01:00
|
|
|
server_tokens {{ nginx_server_token | default(off) }};
|
2023-03-11 18:18:27 +01:00
|
|
|
|
|
|
|
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';
|
|
|
|
|
2023-03-11 21:39:23 +01:00
|
|
|
# Log no IP addresses
|
|
|
|
# access_log /var/log/nginx/access.log noip if=$log_ip;
|
|
|
|
|
|
|
|
access_log {{ nginx_access_log | default(off) }};
|
2023-03-11 18:18:27 +01:00
|
|
|
|
|
|
|
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 %}
|
2023-03-11 18:18:27 +01:00
|
|
|
gzip off;
|
2023-03-11 20:52:04 +01:00
|
|
|
{% endif %}
|
2023-03-11 18:18:27 +01:00
|
|
|
|
|
|
|
##
|
|
|
|
# Virtual Host Configs
|
|
|
|
##
|
|
|
|
include /etc/nginx/conf.d/*.conf;
|
|
|
|
include /etc/nginx/sites-enabled/*;
|
|
|
|
}
|