From cab6271ce1fc667921c3d38b15022dda54604d09 Mon Sep 17 00:00:00 2001 From: "Jan Alexander Steffens (heftig)" <jan.steffens@gmail.com> Date: Thu, 5 Sep 2019 20:48:42 +0200 Subject: [PATCH] nginx.conf: Consistent whitespace --- roles/archweb/templates/nginx.d.conf.j2 | 2 +- .../templates/nginx.d.conf.j2 | 2 +- roles/dbscripts/templates/nginx.d.conf.j2 | 10 +- roles/grafana/templates/nginx.d.conf.j2 | 4 +- roles/nginx/templates/nginx.conf.j2 | 95 ++++++++++--------- 5 files changed, 58 insertions(+), 55 deletions(-) diff --git a/roles/archweb/templates/nginx.d.conf.j2 b/roles/archweb/templates/nginx.d.conf.j2 index b971038f2..a89014ba8 100644 --- a/roles/archweb/templates/nginx.d.conf.j2 +++ b/roles/archweb/templates/nginx.d.conf.j2 @@ -120,7 +120,7 @@ server { } location ~ ^/iso/(.*\.(iso|img|tar\.gz|sfs)$) { - deny all; + deny all; } location /iso { diff --git a/roles/conf.archlinux.org/templates/nginx.d.conf.j2 b/roles/conf.archlinux.org/templates/nginx.d.conf.j2 index 872b6bcba..71d59aeed 100644 --- a/roles/conf.archlinux.org/templates/nginx.d.conf.j2 +++ b/roles/conf.archlinux.org/templates/nginx.d.conf.j2 @@ -38,7 +38,7 @@ server { add_header Strict-Transport-Security $hsts_header; location /2019 { - return 301 $scheme://$server_name; + return 301 $scheme://$server_name; } root {{ conference_dir }}/public; diff --git a/roles/dbscripts/templates/nginx.d.conf.j2 b/roles/dbscripts/templates/nginx.d.conf.j2 index 888a072f1..8530e632b 100644 --- a/roles/dbscripts/templates/nginx.d.conf.j2 +++ b/roles/dbscripts/templates/nginx.d.conf.j2 @@ -40,10 +40,10 @@ server { allow all; } - location / { - auth_basic "Restricted"; - auth_basic_user_file auth/dbscripts.htpasswd; + location / { + auth_basic "Restricted"; + auth_basic_user_file auth/dbscripts.htpasswd; - autoindex on; - } + autoindex on; + } } diff --git a/roles/grafana/templates/nginx.d.conf.j2 b/roles/grafana/templates/nginx.d.conf.j2 index aea7e840e..ce2e119d3 100644 --- a/roles/grafana/templates/nginx.d.conf.j2 +++ b/roles/grafana/templates/nginx.d.conf.j2 @@ -1,5 +1,5 @@ upstream grafana { - server localhost:3000; + server localhost:3000; } server { @@ -34,6 +34,6 @@ server { location / { access_log /var/log/nginx/{{ grafana_domain }}/access.log main; - proxy_pass http://grafana; + proxy_pass http://grafana; } } diff --git a/roles/nginx/templates/nginx.conf.j2 b/roles/nginx/templates/nginx.conf.j2 index a4aa1f4be..35d3af87c 100644 --- a/roles/nginx/templates/nginx.conf.j2 +++ b/roles/nginx/templates/nginx.conf.j2 @@ -4,7 +4,7 @@ load_module /usr/lib/nginx/modules/ngx_http_brotli_filter_module.so; load_module /usr/lib/nginx/modules/ngx_http_brotli_static_module.so; events { - worker_connections 2048; + worker_connections 2048; } worker_rlimit_nofile 2048; @@ -12,48 +12,51 @@ worker_rlimit_nofile 2048; error_log syslog:server=unix:/dev/log,nohostname info; http { - include mime.types; - default_type application/octet-stream; - - log_format main '$remote_addr $host $remote_user [$time_local] "$request" ' - '$status $body_bytes_sent "$http_referer" ' - '"$http_user_agent" "$http_x_forwarded_for" $request_time'; - log_format reduced '$host [$time_local] "$request" ' - '$status $body_bytes_sent "$http_referer" ' - '"$http_user_agent"'; - - log_format json_main escape=json - '{' - '"remote_addr":"$remote_addr",' - '"host":"$host",' - '"remote_user":"$remote_user",' - '"time_local":"$time_local",' - '"request":"$request",' - '"status": "$status",' - '"body_bytes_sent":"$body_bytes_sent",' - '"http_referrer":"$http_referer",' - '"http_user_agent":"$http_user_agent",' - '"http_x_forwarded_for":"$http_x_forwarded_for",' - '"request_time":"$request_time"' - '}'; - - log_format json_reduced escape=json - '{' - '"remote_addr":"$remote_addr",' - '"host":"$host",' - '"remote_user":"$remote_user",' - '"time_local":"$time_local",' - '"request":"$request",' - '"status": "$status",' - '"body_bytes_sent":"$body_bytes_sent",' - '"http_referrer":"$http_referer",' - '"http_user_agent":"$http_user_agent",' - '"http_x_forwarded_for":"$http_x_forwarded_for",' - '"request_time":"$request_time"' - '}'; - - sendfile on; - keepalive_timeout 65; + include mime.types; + default_type application/octet-stream; + + log_format main + '$remote_addr $host $remote_user [$time_local] "$request" ' + '$status $body_bytes_sent "$http_referer" ' + '"$http_user_agent" "$http_x_forwarded_for" $request_time'; + + log_format reduced + '$host [$time_local] "$request" ' + '$status $body_bytes_sent "$http_referer" ' + '"$http_user_agent"'; + + log_format json_main escape=json + '{' + '"remote_addr":"$remote_addr",' + '"host":"$host",' + '"remote_user":"$remote_user",' + '"time_local":"$time_local",' + '"request":"$request",' + '"status": "$status",' + '"body_bytes_sent":"$body_bytes_sent",' + '"http_referrer":"$http_referer",' + '"http_user_agent":"$http_user_agent",' + '"http_x_forwarded_for":"$http_x_forwarded_for",' + '"request_time":"$request_time"' + '}'; + + log_format json_reduced escape=json + '{' + '"remote_addr":"$remote_addr",' + '"host":"$host",' + '"remote_user":"$remote_user",' + '"time_local":"$time_local",' + '"request":"$request",' + '"status": "$status",' + '"body_bytes_sent":"$body_bytes_sent",' + '"http_referrer":"$http_referer",' + '"http_user_agent":"$http_user_agent",' + '"http_x_forwarded_for":"$http_x_forwarded_for",' + '"request_time":"$request_time"' + '}'; + + sendfile on; + keepalive_timeout 65; client_max_body_size 16M; gzip on; @@ -65,13 +68,13 @@ http { http2_max_field_size 8k; - index index.php index.html index.htm; + index index.php index.html index.htm; - {% if fastcgi_cache %} +{% if fastcgi_cache %} fastcgi_cache_path /etc/nginx/wikicache levels=1:2 keys_zone=wiki:100m inactive=60m; fastcgi_cache_key "$scheme$request_method$host$request_uri"; - {% endif %} +{% endif %} access_log syslog:server=unix:/dev/log,nohostname,tag=nginx_http main; include snippets/sslsettings.conf; -- GitLab