rhymix/common/manual/server_config/rhymix-nginx.conf
Kijin Sung 459fe2d959 Fix #1630 short URL for file download conflicts with other nginx directives
다운로드 짧은주소는 /files/download/123/456/filename.jpg 와 같은 형태를 띠므로
nginx에서 특정 확장자에 캐싱 헤더 추가 등의 설정을 걸어놓은 경우
해당 설정이 짧은주소보다 먼저 적용되어 짧은주소에서 404 오류가 나는 문제 해결.
2021-02-23 20:40:00 +09:00

36 lines
1.2 KiB
Text

# block direct access to templates, XML schemas, config files, dotfiles, environment info, etc.
location ~ ^/modules/editor/(skins|styles)/.+\.html$ {
# pass
}
location ~ ^/(addons|common/tpl|files/ruleset|(m\.)?layouts|modules|plugins|themes|widgets|widgetstyles)/.+\.(html|xml)$ {
return 403;
}
location ~ ^/files/(attach|config|cache/store)/.+\.(ph(p|t|ar)?[0-9]?|p?html?|cgi|pl|exe|[aj]spx?|inc|bak)$ {
return 403;
}
location ~ ^/files/(env|member_extra_info/(new_message_flags|point))/ {
return 403;
}
location ~ ^/(\.git|\.ht|\.travis|codeception\.|composer\.|Gruntfile\.js|package\.json|CONTRIBUTING|COPYRIGHT|LICENSE|README) {
return 403;
}
# fix incorrect relative URLs (for legacy support)
location ~ ^/(.+)/(addons|files|layouts|m\.layouts|modules|widgets|widgetstyles)/(.+) {
try_files $uri $uri/ /$2/$3;
}
# fix incorrect minified URLs (for legacy support)
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;
}