ansible-config/roles/nginx/templates/nginx.conf

77 lines
1.6 KiB
Nginx Configuration File
Raw Normal View History

2015-08-29 23:44:14 +02:00
user www-data;
2018-11-03 16:20:39 +01:00
worker_processes {{ nginx_worker_processes }};
2015-08-29 23:44:14 +02:00
pid /run/nginx.pid;
2018-11-03 16:20:39 +01:00
include /etc/nginx/modules-enabled/*.conf;
2015-08-29 23:44:14 +02:00
events {
2018-11-03 16:20:39 +01:00
worker_connections {{ nginx_worker_connections }};
# multi_accept on;
2015-08-29 23:44:14 +02:00
}
http {
2018-11-03 16:20:39 +01:00
##
# Basic Settings
##
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
server_tokens off;
{% if nginx_resolver is defined %}
resolver {{ nginx_resolver }};
{% endif %}
# server_names_hash_bucket_size 64;
# server_name_in_redirect off;
include /etc/nginx/mime.types;
default_type application/octet-stream;
##
# SSL Settings
##
2020-03-23 20:43:06 +01:00
ssl_protocols {{ nginx_tls_versions }};
ssl_ciphers {{ nginx_ciphers }};
ssl_ecdh_curve {{ nginx_curves }};
2018-11-03 16:20:39 +01:00
ssl_prefer_server_ciphers on;
2020-03-23 20:43:06 +01:00
ssl_session_cache shared:SSL:10M;
2018-11-03 16:20:39 +01:00
ssl_session_timeout 10m;
2020-03-23 20:43:06 +01:00
ssl_session_tickets off;
2018-11-03 16:20:39 +01:00
{% if nginx_resolver is defined %}
ssl_stapling on;
ssl_stapling_verify on;
{% endif %}
##
# Logging Settings
##
log_format privacy '$server_name:$server_port 127.0.0.1 - - [$time_local] "$request" $status $body_bytes_sent';
access_log {{ nginx_access_log }};
error_log {{ nginx_error_log }};
##
# Gzip Settings
##
gzip on;
# gzip_vary on;
# gzip_proxied any;
# gzip_comp_level 6;
# gzip_buffers 16 8k;
# gzip_http_version 1.1;
# gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
##
# Virtual Host Configs
##
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
2015-08-29 23:44:14 +02:00
}