我正在研究反向代理 . 我必须映射根上下文路径 .

为此,我必须为例如两个实例 .

ProxyPreserveHost On

# Example:

ProxyPass / abc http://localhost:8080/abc/

ProxyPassReverse / abc http://localhost:8080/abc/

ProxyPass / http://localhost:8080/abc/

ProxyPassReverse / http://localhost:8080/abc/

ServerName localhost

这两个实例背后的原因是

一个 . 第一个实例是必需的,以便apache应该知道应用程序上下文路径,即/ abc .

b . 第二个实例,因为我们需要将根映射到上下文路径 .

我需要映射时遇到问题

就像是:

本地主机:3000 / XYZ

我添加了如下配置:

ProxyPreserveHost On

# Example:

ProxyPass / abc http://localhost:8080/abc/

ProxyPassReverse / abc http://localhost:8080/abc/

ProxyPass / http://localhost:8080/abc/

ProxyPassReverse / http://localhost:8080/abc/

ProxyPass /signIn           http://localhost:3000/xyz

    ProxyPassReverse /signIn  http:// localhost  :3000/xyz



    ProxyPass /signIn        http:// localhost  :3000/xyz

    ProxyPassReverse /signIn  http:// localhost  :3000/xyz

但是当我试图访问时

本地主机/ XYZ

服务器响应404错误 .

请指导我解决上述问题 .