nginx 구성 전달에 대한 조언을 요청하세요.
仅有的幸福
仅有的幸福 2017-05-16 17:07:02
0
1
499

서버 {
listen 443;
server_name localhost api.humanchan.me;
ssl on;
root html;
index index.html index.htm;

if ($http_host ~ "^api.humanchan.me$") {
rewrite ^(.*) https://www.humanchan.me/api/$1 영구;
}

위치 ^~ /api/ {

proxy_pass http://127.0.0.1:7001;
proxy_redirect off;
proxy_set_header X-Real-Ip $remote_addr; -Proto$ 계획;
}

}

https://api.humanchan.me/를 https://www.humanchan.me/api/로 전달해야 하는데 성공하지 못했습니다. 제가 잘못 쓴 건가요? 아니면 어떻게 써야 하나요?
仅有的幸福
仅有的幸福

모든 응답(1)
刘奇

위의 서버는 도메인 이름 api.humanchan.me를 대상으로 하므로 아래에 작성된 /api/는 쓸모가 없습니다. 게다가 이 구성은 이제 api.humanchan.me에 대해 www.humanchan.me/api/로 연결됩니다. 문제?

최신 다운로드
더>
웹 효과
웹사이트 소스 코드
웹사이트 자료
프론트엔드 템플릿
회사 소개 부인 성명 Sitemap
PHP 중국어 웹사이트:공공복지 온라인 PHP 교육,PHP 학습자의 빠른 성장을 도와주세요!