From affe264999277af769fbf48b41c2524e21ae7745 Mon Sep 17 00:00:00 2001 From: alex-phillips Date: Fri, 1 May 2020 13:26:54 -0400 Subject: [PATCH] fixed outdated nginx config, fixed older nginx baseimage version number --- Dockerfile | 2 +- root/defaults/default | 58 ++++++++++++++----------------------------- 2 files changed, 19 insertions(+), 41 deletions(-) diff --git a/Dockerfile b/Dockerfile index d610d42..a38ee39 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM lsiobase/nginx:3.10 +FROM lsiobase/nginx:3.11 # set version label ARG BUILD_DATE diff --git a/root/defaults/default b/root/defaults/default index 9061b20..db0faba 100644 --- a/root/defaults/default +++ b/root/defaults/default @@ -1,49 +1,27 @@ -## Version 2020/05/01 - Changelog: https://github.com/linuxserver/docker-lychee/commits/master/root/defaults/default - server { - listen 80 default_server; + listen 80 default_server; + root /app/lychee/public; + index index.html index.htm index.php; - listen 443 ssl; + server_name _; + client_max_body_size 0; - root /app/lychee/public; - index index.php index.html index.htm; - - server_name _; - - ssl_certificate /config/keys/cert.crt; - ssl_certificate_key /config/keys/cert.key; - - client_max_body_size 0; - - error_page 599 = @noauth; - - location / { - if (!-f /config/nginx/.htpasswd) { - return 599; - } - auth_basic "Restricted"; - auth_basic_user_file /config/nginx/.htpasswd; - try_files $uri $uri/ /index.php?$args; + location / { + try_files $uri $uri/ /index.html /index.php?$args =404; } - location @noauth { - try_files $uri $uri/ /index.php?$args; + location ~* \.(?:ico|css|js|gif|jpe?g|png)$ { + expires max; + add_header Pragma public; + add_header Cache-Control "public, must-revalidate, proxy-revalidate"; } - # unless the request is for a valid file (image, js, css, etc.), send to bootstrap - if (!-e $request_filename) - { - rewrite ^/(.*)$ /index.php?/$1 last; - break; + location ~ \.php$ { + fastcgi_split_path_info ^(.+\.php)(/.+)$; + fastcgi_pass 127.0.0.1:9000; + fastcgi_index index.php; + fastcgi_read_timeout 1800; + fastcgi_send_timeout 1800; + include /etc/nginx/fastcgi_params; } - - location ~ \.php$ { - fastcgi_split_path_info ^(.+\.php)(/.+)$; - # With php5-cgi alone: - fastcgi_pass 127.0.0.1:9000; - # With php5-fpm: - #fastcgi_pass unix:/var/run/php5-fpm.sock; - fastcgi_index index.php; - include /etc/nginx/fastcgi_params; - } }