mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-04 01:01:41 +09:00
Update recommended nginx configuration
- Rewrite legacy paths only if the requested file does not exist. - Add example configuration for installation in a subdirectory.
This commit is contained in:
parent
866b709f36
commit
d2c98830cc
3 changed files with 67 additions and 2 deletions
|
|
@ -126,10 +126,13 @@ Rhymix의 설치 경로가 **/var/www/html**이라면,
|
|||
|
||||
를 추가하면 됩니다. 하지만, 위와 같은 형식의 추가는 웹서버의 디렉터리를 참조하기 때문에 rhymix-nginx.conf 파일이 변조되었을 때 nginx의 rewrite 설정도 함께 바뀌기 때문에 **절대로 사용해서는 안됩니다.**
|
||||
|
||||
## 만약 Rhymix를 설치한 경로가 서브디렉토리라면
|
||||
|
||||
rhymix-nginx-subdir.conf 파일을 적당히 수정하여 사용하시기 바랍니다.
|
||||
|
||||
## 만약 가상호스트 설정이 되어 있지 않다면
|
||||
만약 nginx.conf에 위와 비슷한 경로를 인클루드하는 구문이 **없다면** 추가 해 주도록 합시다. 핵심은 **경로를 인클루드 하는 것**입니다.
|
||||
|
||||
|
||||
대부분의 리눅스 배포판에서는 server 블럭이 nginx.conf에 존재하지 않습니다. 따라서 특정 경로를 인클루드 하는 구문을 **추가하기만 하면 됩니다.** 이때, **nginx.conf**에 **server {} 블럭이 존재하면 에러가 발생할 수도 있습니다.** 따라서 **인클루드 구문을 없었는데 추가했다면** server 블럭을 찾아서 삭제해주도록 합니다. 예시를 들어 보여드리겠습니다.
|
||||
|
||||
|
||||
|
|
|
|||
60
common/manual/server_config/rhymix-nginx-subdir.conf
Normal file
60
common/manual/server_config/rhymix-nginx-subdir.conf
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
# block direct access to templates, XML schemas, config files, dotfiles, environment info, etc.
|
||||
location ~ ^/rhymix/modules/editor/(skins|styles)/.+\.html$ {
|
||||
# pass
|
||||
}
|
||||
location ~ ^/rhymix/common/manual/.+\.html$ {
|
||||
# pass
|
||||
}
|
||||
location ~ ^/rhymix/(addons|common|files/ruleset|(m\.)?layouts|modules|plugins|themes|widgets|widgetstyles)/.+\.(html|xml)$ {
|
||||
return 403;
|
||||
}
|
||||
location ~ ^/rhymix/files/(attach|config|cache/store)/.+\.php$ {
|
||||
return 403;
|
||||
}
|
||||
location ~ ^/rhymix/files/env/ {
|
||||
return 403;
|
||||
}
|
||||
location ~ ^/rhymix/(\.|codeception\.|composer\.|Gruntfile\.js|package\.json|CONTRIBUTING|COPYRIGHT|LICENSE|README) {
|
||||
return 403;
|
||||
}
|
||||
|
||||
# fix incorrect relative URLs (for legacy support)
|
||||
location ~ ^/rhymix/(.+)/(addons|files|layouts|m\.layouts|modules|widgets|widgetstyles)/(.+) {
|
||||
try_files $uri $uri/ /rhymix/$2/$3;
|
||||
}
|
||||
|
||||
# rss, blogAPI
|
||||
rewrite ^/rhymix/(rss|atom)$ /rhymix/index.php?module=rss&act=$1 last;
|
||||
rewrite ^/rhymix/([a-zA-Z0-9_]+)/(rss|atom|api)$ /rhymix/index.php?mid=$1&act=$2 last;
|
||||
rewrite ^/rhymix/([a-zA-Z0-9_]+)/([a-zA-Z0-9_]+)/(rss|atom|api)$ /rhymix/index.php?vid=$1&mid=$2&act=$3 last;
|
||||
|
||||
# trackback
|
||||
rewrite ^/rhymix/([0-9]+)/(.+)/trackback$ /rhymix/index.php?document_srl=$1&key=$2&act=trackback last;
|
||||
rewrite ^/rhymix/([a-zA-Z0-9_]+)/([0-9]+)/(.+)/trackback$ /rhymix/index.php?vid=$1&document_srl=$2&key=$3&act=trackback last;
|
||||
|
||||
# administrator page
|
||||
rewrite ^/rhymix/admin/?$ /rhymix/index.php?module=admin last;
|
||||
|
||||
# document category
|
||||
rewrite ^/rhymix/([a-zA-Z0-9_]+)/category/([0-9]+)$ /rhymix/index.php?mid=$1&category=$2 last;
|
||||
|
||||
# document permanent link
|
||||
rewrite ^/rhymix/([0-9]+)$ /rhymix/index.php?document_srl=$1 last;
|
||||
|
||||
# mid link
|
||||
rewrite ^/rhymix/([a-zA-Z0-9_]+)/?$ /rhymix/index.php?mid=$1 last;
|
||||
|
||||
# mid + document link
|
||||
rewrite ^/rhymix/([a-zA-Z0-9_]+)/([0-9]+)$ /rhymix/index.php?mid=$1&document_srl=$2 last;
|
||||
|
||||
# vid + mid link
|
||||
rewrite ^/rhymix/([a-zA-Z0-9_]+)/([a-zA-Z0-9_]+)/?$ /rhymix/index.php?vid=$1&mid=$2 last;
|
||||
|
||||
# vid + mid + document link
|
||||
rewrite ^/rhymix/([a-zA-Z0-9_]+)/([a-zA-Z0-9_]+)/([0-9]+)$ /rhymix/index.php?vid=$1&mid=$2&document_srl=$3 last;
|
||||
|
||||
# mid + entry title
|
||||
rewrite ^/rhymix/([a-zA-Z0-9_]+)/entry/(.+)$ /rhymix/index.php?mid=$1&entry=$2 last;
|
||||
|
||||
# vid + mid + entry title
|
||||
rewrite ^/rhymix/([a-zA-Z0-9_]+)/([a-zA-Z0-9_]+)/entry/(.+)$ /rhymix/index.php?vid=$1&mid=$2&entry=$3 last;
|
||||
|
|
@ -19,7 +19,9 @@ location ~ ^/(\.|codeception\.|composer\.|Gruntfile\.js|package\.json|CONTRIBUTI
|
|||
}
|
||||
|
||||
# fix incorrect relative URLs (for legacy support)
|
||||
rewrite ^/(.+)/(addons|files|layouts|m\.layouts|modules|widgets|widgetstyles)/(.*) /$2/$3 last;
|
||||
location ~ ^/(.+)/(addons|files|layouts|m\.layouts|modules|widgets|widgetstyles)/(.+) {
|
||||
try_files $uri $uri/ /$2/$3;
|
||||
}
|
||||
|
||||
# rss, blogAPI
|
||||
rewrite ^/(rss|atom)$ /index.php?module=rss&act=$1 last;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue