
cname을 사용할 수 없으므로 서비스를 하위 디렉터리로 분할하고 싶습니다.
location /ha/
{
proxy_pass http://localhost:58123/; #local IP of my HA server
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
이렇게 하면 HA 로고가 표시되지만 개발자 콘솔에서는 그가 기본 측면에서 파일을 로드하려고 시도하는 것을 볼 수 있습니다.
예를 들어 대신 /ha/frontend_latest/app.83207343.js
나는/frontend_latest/app.83207343.js
답변1
예, 귀하의 /ha/
페이지가 /frontend_latest/app.83207343.js
리소스로 나열되어 있기 때문입니다. 이 문제를 해결하는 세 가지 방법이 있습니다.
- 애플리케이션에 상대 경로를 사용해야 한다고 지시하세요. 예:
frontend_latest/app.83207343.js
- 절대 경로를 사용해야 하지만 올바른 경로(예
/ha/frontend_latest/app.83207343.js
: . - 다음과 같은 것을 사용하십시오ngx_http_sub즉석에서 다시 작성합니다.