diff --git a/roles/archweb/templates/nginx.d.conf.j2 b/roles/archweb/templates/nginx.d.conf.j2 index b971038f2a59277590bf14d9a704466c50dbcf90..a89014ba86620f9d8f96ec28fcc37bdd83fc52ba 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 872b6bcba5026c2f432bc7eacd471583d876d3cd..71d59aeed1725805c5b589135524f4e48888242b 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 888a072f181963ae7a3f481f7e71b34670712bc1..8530e632ba8107b6d30239b834d4df23f8235918 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 aea7e840ea989b0d0d144cd68ad2ad1959ef7f72..ce2e119d3e5758a3748d944711f6fe7f4ce39b53 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 a4aa1f4be2094f51f38851f7d306cec49c8a8bdb..35d3af87c0ca1c06f73e8d200149ca9e89a54561 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;