V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
MuSit
V2EX  ›  问与答

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

  •  
  •   MuSit · Mar 9, 2019 · 890 views
    This topic created in 2606 days ago, the information mentioned may be changed or developed.

    我在一台服务器下用 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 正常使用

    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1829 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 16:22 · PVG 00:22 · LAX 09:22 · JFK 12:22
    ♥ Do have faith in what you're doing.