如果项目根路径不为空,需要多做一层映射,防止前后端来回重定向;

    server{
        listen        80;
        server_name   pmp.mussessein.cn;
        
        location / {
            root   html;
            proxy_pass  http://127.0.0.1:9000/pmp;
            proxy_redirect off;
            proxy_set_header     Host  $host;
            proxy_set_header      ROMOTE_ADDR  $remote_addr;
            proxy_set_header     X-Forwarded-For  $proxy_add_x_forwarded_for;
            real_ip_header    X-Forwarded-For;
            real_ip_recursive   on;
        }
        location /pmp {
            root   html;
            proxy_redirect off;
            proxy_set_header     Host  $host;
            proxy_set_header      ROMOTE_ADDR  $remote_addr;
            proxy_set_header     X-Forwarded-For  $proxy_add_x_forwarded_for;
            real_ip_header    X-Forwarded-For;
            real_ip_recursive   on;
            proxy_pass  http://127.0.0.1:9000/pmp;
            index  index.html index.htm;
        }
        location = /50x.html{
            root  html;
        }
    }

相关文章:

  • 2021-08-28
  • 2021-06-02
  • 2021-06-27
  • 2022-12-23
  • 2021-12-23
  • 2021-04-07
猜你喜欢
  • 2021-10-03
  • 2022-12-23
  • 2021-12-12
  • 2022-12-23
  • 2021-11-10
  • 2021-05-11
  • 2022-12-23
相关资源
相似解决方案