From 459fe2d959ce1be212c92137321d4e3a2fb01432 Mon Sep 17 00:00:00 2001 From: Kijin Sung Date: Tue, 23 Feb 2021 20:40:00 +0900 Subject: [PATCH] Fix #1630 short URL for file download conflicts with other nginx directives MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 다운로드 짧은주소는 /files/download/123/456/filename.jpg 와 같은 형태를 띠므로 nginx에서 특정 확장자에 캐싱 헤더 추가 등의 설정을 걸어놓은 경우 해당 설정이 짧은주소보다 먼저 적용되어 짧은주소에서 404 오류가 나는 문제 해결. --- common/manual/server_config/rhymix-nginx-subdir.conf | 5 +++++ common/manual/server_config/rhymix-nginx.conf | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/common/manual/server_config/rhymix-nginx-subdir.conf b/common/manual/server_config/rhymix-nginx-subdir.conf index 06d370827..335c1626c 100644 --- a/common/manual/server_config/rhymix-nginx-subdir.conf +++ b/common/manual/server_config/rhymix-nginx-subdir.conf @@ -25,6 +25,11 @@ location ~ ^/rhymix/(.+)\.min\.(css|js)$ { try_files $uri $uri/ /rhymix/$1.$2; } +# fix download URL when other directives for static files are present +location ~ ^/rhymix/files/download/ { + try_files $uri $uri/ /rhymix/index.php$is_args$args; +} + # all other short URLs location /rhymix/ { try_files $uri $uri/ /rhymix/index.php$is_args$args; diff --git a/common/manual/server_config/rhymix-nginx.conf b/common/manual/server_config/rhymix-nginx.conf index 04306e0bd..53a64c23c 100644 --- a/common/manual/server_config/rhymix-nginx.conf +++ b/common/manual/server_config/rhymix-nginx.conf @@ -25,6 +25,11 @@ location ~ ^/(.+)\.min\.(css|js)$ { try_files $uri $uri/ /$1.$2; } +# fix download URL when other directives for static files are present +location ~ ^/files/download/ { + try_files $uri $uri/ /index.php$is_args$args; +} + # all other short URLs location / { try_files $uri $uri/ /index.php$is_args$args;