infra/roles/nginx/templates/nginx.conf.j2

76 lines
2.1 KiB
Django/Jinja

user www-data;
worker_processes auto;
error_log /var/log/nginx/default_error.log warn;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
# nginx hack
# if $authelia_user doesnt exist, set it to empty string
# if $authelia_user does exist, do nothing
# map $host $authelia_user {
# "" "";
# default $authelia_user;
# }
# map $host $authelia_groups {
# "" "";
# default $authelia_groups;
# }
map $host $authelia_user {
default "";
}
map $host $authelia_groups {
default "";
}
log_format main '{"remote_addr": "$remote_addr", '
' "remote_user": "$remote_user", '
' "authelia_user": "$authelia_user", '
' "authelia_groups": "$authelia_groups", '
' "time_local": "$time_local", '
' "request": "$request", '
' "request_method": "$request_method", '
' "request_uri": "$request_uri", '
' "uri": "$uri", '
' "http_connection": "$http_connection", '
' "http_upgrade": "$http_upgrade", '
' "server_name": "$server_name", '
' "server_port": "$server_port", '
' "status": "$status", '
' "body_bytes_sent": $body_bytes_sent, '
' "http_referer": "$http_referer", '
' "http_host": "$http_host", '
' "http_user_agent": "$http_user_agent", '
' "http_x_forwarded_for": "$http_x_forwarded_for"}';
access_log /var/log/nginx/access_default.log main;
error_log /var/log/nginx/error_default.log;
sendfile on;
#tcp_nopush on;
keepalive_timeout 65;
#gzip on;
server_tokens off;
{# proxy_cache_path /var/cache/nginx levels=1:2 keys_zone=AUTH:10m inactive=24h; #}
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
}