Extra Form
PHP PHP 7.2
CMS Rhymix 2.x

라이믹스 2.x 최신버젼으로 업그레이드를 완료했습니다. ( nginx/1.19.0 )

 

 

xe를 거쳐 라이믹스 1.8버전대에서 사용하던  /etc/nginx/snippets/xe-rewrite.conf 파일 기존 내용을 vi 에디터에서 모두 지우고 라이믹스 2.0에서 권장하는  rewrite 규칙 ( https://github.com/rhymix/rhymix/blob/master/common/manual/server_config/rhymix-nginx.conf ) 내용으로 대체해서 변경 저장하였습니다.

 

라이믹스 2.x 최신 버전에서 가존 사용하던 몇개 모듈에서 에러가 발생하거나 아래 짧은 주소 사용에서 "모든 주소 형태를 사용"을 지정하면 부분부분 에러 문제가 발생하고 있는 상황입니다.

2022-01-26 10,34,22.JPEG

 

혹시 라이믹스 2.x 업그레이드 전 사용하던 아래 rewrite 규칙 내용들을 라이믹스 2.0에서 권장하는  rewrite 규칙 ( https://github.com/rhymix/rhymix/blob/master/common/manual/server_config/rhymix-nginx.conf  ) 내용 상단 또는 하단에  그대로 추가 하는 경우 일부 문제가 발생하는 모듈에서 정상 사용이 가능할런지 문의드립니다.

 

[ 라이믹스 2.x 업그레이드 전 정상 작동 되던 때의 사용했던 rewrite 규칙  내용 ]

 

# block direct access to templates, XML schemas, config files, dotfiles, environment info, etc.
location ~ ^/modules/editor/(skins|styles)/.+\.html$ {
    # pass
}
location ~ ^/(admin/help|common/manual)/.+\.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|jshint)|codeception\.|composer\.|Gruntfile\.js|package\.json|CONTRIBUTING|COPYRIGHT|LICENSE|README) {
    return 403;
}

# fix incorrect relative URLs (for legacy support)
location ~ ^/(.+)/(addons|common|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;
}

# rss, blogAPI
rewrite ^/(rss|atom)$ /index.php?module=rss&act=$1 last;
rewrite ^/([a-zA-Z0-9_]+)/(rss|atom|api)$ /index.php?mid=$1&act=$2 last;
rewrite ^/([a-zA-Z0-9_]+)/([a-zA-Z0-9_]+)/(rss|atom|api)$ /index.php?vid=$1&mid=$2&act=$3 last;

# trackback
rewrite ^/([0-9]+)/(.+)/trackback$ /index.php?document_srl=$1&key=$2&act=trackback last;
rewrite ^/([a-zA-Z0-9_]+)/([0-9]+)/(.+)/trackback$ /index.php?vid=$1&document_srl=$2&key=$3&act=trackback last;

# administrator page
rewrite ^/admin/?$ /index.php?module=admin last;

# document category
rewrite ^/([a-zA-Z0-9_]+)/category/([0-9]+)$ /index.php?mid=$1&category=$2 last;

# document permanent link
rewrite ^/([0-9]+)$ /index.php?document_srl=$1 last;

# mid link
location ~ ^/([a-zA-Z0-9_]+)/?$ {
    try_files $uri $uri/ /index.php?mid=$1;
}

# mid + document link
rewrite ^/([a-zA-Z0-9_]+)/([0-9]+)$ /index.php?mid=$1&document_srl=$2 last;

# vid + mid link
rewrite ^/([a-zA-Z0-9_]+)/([a-zA-Z0-9_]+)/?$ /index.php?vid=$1&mid=$2 last;

# vid + mid + document link
rewrite ^/([a-zA-Z0-9_]+)/([a-zA-Z0-9_]+)/([0-9]+)$ /index.php?vid=$1&mid=$2&document_srl=$3 last;

# mid + entry title
rewrite ^/([a-zA-Z0-9_]+)/entry/(.+)$ /index.php?mid=$1&entry=$2 last;

# vid + mid + entry title
rewrite ^/([a-zA-Z0-9_]+)/([a-zA-Z0-9_]+)/entry/(.+)$ /index.php?vid=$1&mid=$2&entry=$3 last;

# rhymix file download
rewrite ^/files/download/([0-9]+)/([a-zA-Z0-9_-]+)/(.+)$ /index.php?act=procFileOutput&file_srl=$1&file_key=$2&filename=$3 last;
rewrite ^/@([a-zA-Z0-9가-힇_]+)/?$ /index.php?mid=some&act=dispSomethingProfileView&smember=$1 last;
 

  • profile
    안되겠죠? 코어에서 변경된 부분이 있어서 rewrite 규칙이 변경이 된건데요.
    기존 사용하는 자료들에 문제가 생겨서 "XE 호환 주소" 로 설정해서 운영합니다.
  • profile ?

    말씀 주신 대로 xe호환주소로 사용중이긴 한데 rewrite 규칙에 대한 정확한 이해가 없어서요.^^;
    문제가 발생하는 모듈들은 라이믹스 2.0대에 맞는 방식으로 rewrite규칙을 새로 작성, 추가 해줘야 하는걸로 이해하겠습니다.

  • ? profile

    라이믹스 2.0은 필요에 따라 서버에 rewrite 규칙을 추가하는 것이 아니라
    특정한 형태의 짧은주소를 쓰고 싶은 모듈이 module.xml에서 규칙을 선언하는 방식입니다.
    서버의 rewrite 규칙을 수정할 필요 없이 모듈마다 원하는 형태의 주소를 구현할 수 있고,

    반면, 모듈에서 rewrite 규칙을 건드리는 것은 허용되지 않습니다.

    즉, module.xml에서 정식으로 선언하지 않은 형태의 주소라면
    nginx rewrite 쪽에서 아무리 건드려도 코어에서 처리해 주지 않기 때문에 무의미합니다.
    모듈 내에서 선언하지 않고 남의 서버에 rewrite 규칙을 임의로 추가하라고 알려주는 자료들은
    이 시스템 하에서는 모두 문제가 됩니다.

     

    과거와 달리 모듈 내에서 할 수 있는 일이 훨씬 많아졌기 때문에

    정당한 이유 없이 그 범위를 벗어나는 자료에 대한 배려는 점점 줄어들고 있습니다.

  • profile

    서드파티 자료가 많은 기존 사이트라면 그냥 XE 호환 주소만 쓰시는 것을 권장합니다.

    물론, 새로운 rewrite 규칙을 반드시 필요로 하는 신규 자료가 나온다면

    둘 중 어느 쪽을 포기할지 선택하셔야겠지만요, 아직은 그렇지 않으니까요.

  • profile ?

    답변감사합니다. ^^

  • profile

    막줄의 썸씽모듈 rewrite 규칙이 문제라면 타운에서 몇 차례 얘기가 나왔던 적이 있는 것 같으니 좀더 찾아보시면 땜빵하는 방법이 나올 것 같습니다. 개발자분이 타운에 가끔 들르신다면 module.xml에서 라이믹스 2.0 방식에 맞게 global route 설정 하나쯤 추가하는 법을 연구해 볼 수도 있겠고요.

  • profile profile
    관련 이슈에 댓글로 현재 시점에서 해결책이 있습니다.
    https://github.com/rhymix/rhymix/issues/1795
  • profile ?
    감사합니다.^^
  • profile ?
    감사합니다.^^