Resolved: Quartz wiki 404 on Korean-character URLs (괄호 slug) #2

Closed
opened 2026-05-05 21:37:42 +09:00 by ruki · 0 comments
Collaborator

문제 (2026-05-05)

위키 페이지(wiki.pinksky.kr) 첫 접속은 되지만 새로고침이나 직접 URL 접근Directory listing 또는 404 오류.
특히 폴더명에 괄호가 포함된 경로(예: 01_PROJECTS(프로젝트))에서만 발생.

원인

  • Quartz 내부 slug 에는 괄호 문자가 없음 (01_PROJECTS)
  • 브라우저가 괄호 포함 URL을 요청하면 Caddy가 파일을 못찾고 directory listing 반환
  • SPA fallback(index.html) 없었음

해결

/opt/homebrew/etc/Caddyfile 수정:

@parens path_regexp parens ^(.+?)\([^)]+\)(.*)$
redir @parens {re.parens.1}{re.parens.2} permanent

root * /Users/pinksky/quartz/public
encode gzip
try_files {path} {path}/index.html /index.html
file_server
  1. @parens 매처: URL 에서 괄호+한글 부분을 제거한 뒤 redirect
  2. try_files: 파일 없으면 /index.html 로 fallback → Quartz 내부 라우터가 path 처리

결과

01_PROJECTS(프로젝트)/A_mini-happy/ 등 모든 한글 경로 → HTTP 200 확인

[!note] 수정이력 | 2026-05-05, 루키 (hermes)

## 문제 (2026-05-05) 위키 페이지(`wiki.pinksky.kr`) 첫 접속은 되지만 **새로고침이나 직접 URL 접근** 시 `Directory listing` 또는 404 오류. 특히 폴더명에 괄호가 포함된 경로(예: `01_PROJECTS(프로젝트)`)에서만 발생. ## 원인 - Quartz 내부 slug 에는 괄호 문자가 없음 (`01_PROJECTS`) - 브라우저가 괄호 포함 URL을 요청하면 Caddy가 파일을 못찾고 directory listing 반환 - SPA fallback(`index.html`) 없었음 ## 해결 `/opt/homebrew/etc/Caddyfile` 수정: ``` @parens path_regexp parens ^(.+?)\([^)]+\)(.*)$ redir @parens {re.parens.1}{re.parens.2} permanent root * /Users/pinksky/quartz/public encode gzip try_files {path} {path}/index.html /index.html file_server ``` 1. `@parens` 매처: URL 에서 괄호+한글 부분을 제거한 뒤 redirect 2. `try_files`: 파일 없으면 `/index.html` 로 fallback → Quartz 내부 라우터가 path 처리 ## 결과 `01_PROJECTS(프로젝트)/A_mini-happy/` 등 모든 한글 경로 → `HTTP 200` 확인 > [!note] 수정이력 | 2026-05-05, 루키 (hermes)
ruki closed this issue 2026-05-05 21:37:42 +09:00
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: pinksky/minicity-agent#2