
내 루트 핸들러가 nginx의 하위 경로 위치를 재정의하는 이유는 무엇입니까?
nginx에서 작업하고 있는 레벨은 2개입니다 /***
./core/
나는 다음과 같은 일이 일어나기를 원합니다:
- 누군가 전화할 때
/fun/
- 다른 서버로 Proxy_pass - 누군가 전화할 때
/notfun/
- 다른 서버로 Proxy_pass - 누군가 전화하면
/core/
- index.html을 반환합니다. - 누군가 전화하면
/core/file.html
파일이 있습니다. 파일을 돌려주세요. - 누군가 전화했는데
/core/thing/
파일이 없으면 index.html을 반환하세요.
누군가 전화를 걸면 404를 생성하는 것이 불가능해야 합니다./core/****
내 위치 선언은 다음과 같습니다.
location / {
set $a_url nginx.router;
proxy_pass https://$a_url;
}
location /core/ {
alias /app/;
try_files $uri $uri/ /index.html;
}
location /
선언, 요구 사항 5 중단을 추가하면 어떻게 되나요 ?
[17/Dec/2020:23:37:16 +0000] "GET /core/aaaa HTTP/1.1" 404 153 "-" "curl/7.64.0"