yapi 的 nginx 反向代理配置文字

Colorado發表於2020-06-19

不瞭解yapi的同學可以百度一下哈,就是一款API管理工具,以下為本人實際配置,親測可用哈

upstream yapi {
  server 127.0.0.1:3000 weight=5;
}

server {
    listen       80;
    server_name  localhost yapi.iamphper.cn;
    #charset koi8-r;
    #access_log  logs/host.access.log  main;

    location / {
      proxy_pass  http://yapi;
      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 X-NginX-Proxy true;
      proxy_set_header Connection "upgrade";
      proxy_set_header Upgrade $http_upgrade;
      proxy_http_version 1.1;
    }
}
本作品採用《CC 協議》,轉載必須註明作者和本文連結

相關文章