From adda2b30f9369afe60d5495135d0a8fdbe58e325 Mon Sep 17 00:00:00 2001 From: Untone Date: Tue, 3 Jun 2025 00:35:32 +0300 Subject: [PATCH] less-config --- nginx.conf.sigil | 36 ++---------------------------------- 1 file changed, 2 insertions(+), 34 deletions(-) diff --git a/nginx.conf.sigil b/nginx.conf.sigil index 908de6b..5471c60 100644 --- a/nginx.conf.sigil +++ b/nginx.conf.sigil @@ -11,24 +11,16 @@ server { listen [::]:{{ $listen_port }}; listen {{ $listen_port }}; server_name {{ $.NOSSL_SERVER_NAME }}; - access_log /var/log/nginx/{{ $.APP }}-access.log; - error_log /var/log/nginx/{{ $.APP }}-error.log; client_max_body_size 100M; {{ else if eq $scheme "https" }} listen [::]:{{ $listen_port }} ssl http2; listen {{ $listen_port }} ssl http2; server_name {{ $.NOSSL_SERVER_NAME }}; - access_log /var/log/nginx/{{ $.APP }}-access.log; - error_log /var/log/nginx/{{ $.APP }}-error.log; ssl_certificate {{ $.APP_SSL_PATH }}/server.crt; ssl_certificate_key {{ $.APP_SSL_PATH }}/server.key; ssl_protocols TLSv1.2 TLSv1.3; ssl_prefer_server_ciphers off; - - keepalive_timeout 70; - keepalive_requests 500; - proxy_read_timeout 3600; client_max_body_size 100M; {{ end }} @@ -37,37 +29,13 @@ server { {{ $proxy_settings }} } - # Кеширование медиа файлов в браузере (не на сервере) + # Browser caching for media files location ~* \.(jpg|jpeg|png|gif|ico|webp|mp3|wav|ogg|flac|aac|aif|webm|pdf)$ { - proxy_pass http://{{ $.APP }}-{{ $upstream_port }}; + proxy_pass http://{{ $.APP }}-{{ $upstream_port }}; expires 30d; add_header Cache-Control "public, immutable"; } - error_page 400 401 402 403 405 406 407 408 409 410 411 412 413 414 415 416 417 418 420 422 423 424 426 428 429 431 444 449 450 451 /400-error.html; - location /400-error.html { - root /var/lib/dokku/data/nginx-vhosts/dokku-errors; - internal; - } - - error_page 404 /404-error.html; - location /404-error.html { - root /var/lib/dokku/data/nginx-vhosts/dokku-errors; - internal; - } - - error_page 500 501 503 504 505 506 507 508 509 510 511 /500-error.html; - location /500-error.html { - root /var/lib/dokku/data/nginx-vhosts/dokku-errors; - internal; - } - - error_page 502 /502-error.html; - location /502-error.html { - root /var/lib/dokku/data/nginx-vhosts/dokku-errors; - internal; - } - include {{ $.DOKKU_ROOT }}/{{ $.APP }}/nginx.conf.d/*.conf; } {{ end }}