>  Q&A  >  본문

nginx 구성 전달에 대한 조언을 요청하세요.

서버 {
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/로 전달해야 하는데 성공하지 못했습니다. 제가 잘못 쓴 건가요? 아니면 어떻게 써야 하나요?
仅有的幸福仅有的幸福2714일 전506

모든 응답(1)나는 대답할 것이다

  • 怪我咯

    怪我咯2017-05-16 17:09:02

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

    회신하다
    0
  • 취소회신하다