nginx 設定の転送についてアドバイスを求める
仅有的幸福
仅有的幸福 2017-05-16 17:07:02
0
1
498

サーバー {
listen 443;
server_name localhost api.humanchan.me;
ssl on;
root html;
indexindex.htmlindex.htm;

if ($http_host ~ "^api.humanchan.me$") {
書き換え ^(.*) https://www.humanchan.me/api/$1 Permanent;
}

場所 ^~ /api/ {

proxy_pass http://127.0.0.1:7001;
proxy_redirect オフ;
proxy_set_header ホスト $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; to$ スキーム;
}

}

https://api.humanchan.me/ を https://www.humanchan.me/api/ に転送する必要がありますが、書き方が間違っていたのでしょうか、それともどのように書けばよいのでしょうか?

仅有的幸福
仅有的幸福

全員に返信(1)
刘奇

上記のサーバーはドメイン名 api.humanchan.me をターゲットとしているため、以下に記述されている /api/ は役に立ちません。また、この設定は api.humanchan.me に対して www.humanchan.me/api/ にアクセスします。問題? ?

いいねを押す +0
人気のチュートリアル
詳細>
最新のダウンロード
詳細>
ウェブエフェクト
公式サイト
サイト素材
フロントエンドテンプレート
私たちについて 免責事項 Sitemap
PHP中国語ウェブサイト:福祉オンライン PHP トレーニング,PHP 学習者の迅速な成長を支援します!