V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
MuSit
V2EX  ›  问与答

求解答关于 Nginx 在一台服务器上反向代理两个 webapp 的问题

  •  
  •   MuSit · 2019-03-09 14:08:31 +08:00 · 658 次点击
    这是一个创建于 1892 天前的主题,其中的信息可能已经有所发展或是发生改变。

    我在一台服务器下用 nginx 反向代理两个绑定在 2001 和 3000 端口的 webapp, 其中 2001 端口的 webapp 在 nginx 配置中 location 为‘/’,可以正常运行, 3000 端口配置为'/bbs/',只能访问 /index 页面,在页面中点击链接跳转后的返回是 404 这是我的 nginx 配置文件 ''' server{

        listen 80;
        server_name www.sanrialab.xyz;
        location   / {
                proxy_pass http://149.28.76.130:2001;}
        location /bbs/{
                proxy_pass http://localhost:3000/;
                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_redirect  default;}}
    

    请问该怎么配置才能让我 3000 端口上的 webapp 正常使用

    目前尚无回复
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   1067 人在线   最高记录 6547   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 19:17 · PVG 03:17 · LAX 12:17 · JFK 15:17
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.