From 32eb6b550857d861cd5bbf467806e06c2c8bc7bd Mon Sep 17 00:00:00 2001 From: Chris Yocum Date: Thu, 4 Jul 2019 11:45:12 -0400 Subject: [PATCH] Fixes for the API not working Modified the PHP location block to allow the API to function properly. Thanks to @halianelf for that. Added increased fastcgi timeout to account for actions on massive directories. --- root/defaults/default | 60 ++++++++++++++++++++++--------------------- 1 file changed, 31 insertions(+), 29 deletions(-) diff --git a/root/defaults/default b/root/defaults/default index d402ebb..a5a6d89 100644 --- a/root/defaults/default +++ b/root/defaults/default @@ -1,43 +1,45 @@ -## Version 2018/11/09 - Changelog: https://github.com/linuxserver/docker-diskover/commits/master/root/defaults/default - server { - listen 80 default_server; + listen 80 default_server; - listen 443 ssl; + listen 443 ssl; - root /app/diskover-web/public; - index index.php index.html index.htm; + root /app/diskover-web/public; + index index.php index.html index.htm; - server_name _; + server_name _; - ssl_certificate /config/keys/cert.crt; - ssl_certificate_key /config/keys/cert.key; + ssl_certificate /config/keys/cert.crt; + ssl_certificate_key /config/keys/cert.key; - client_max_body_size 0; + client_max_body_size 0; - error_page 599 = @noauth; + error_page 599 = @noauth; - location / { - if (!-f /config/nginx/.htpasswd) { + location / { + if (!-f /config/nginx/.htpasswd) { return 599; } - auth_basic "Restricted"; + + auth_basic "Restricted"; auth_basic_user_file /config/nginx/.htpasswd; try_files $uri $uri/ /index.php?$args; - } - - location @noauth { - try_files $uri $uri/ /index.php?$args; - } - - 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; - } + + location @noauth { + try_files $uri $uri/ /index.php?$args; + } + + location ~ \.php(/|$) { + fastcgi_split_path_info ^(.+\.php)(/.+)$; + set $path_info $fastcgi_path_info; + fastcgi_param PATH_INFO $path_info; + try_files $fastcgi_script_name =404; + # 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; + fastcgi_read_timeout 900; + } }