[EDITED]

我们正在尝试将现有的Apache服务器代理服务器运行Angular应用程序的节点js服务器 . 我们的Node JS应用程序包含API方法和Angular 6前端的集合 .

Apache监听[https://our site]我们想要一个子目录[https://our site] / v4来支持我们在http://localhost:3000上运行的节点js

到目前为止,我们已将此配置项添加到httpd.conf中

ProxyPass /v4 http://localhost:3000
    ProxyPassReverse /v4 http://localhost:3000

对于Angular部分,这导致:

styles.js:1 Failed to load resource: the server responded with a status of 404 (Not Found)
runtime.js:1 Failed to load resource: the server responded with a status of 404 (Not Found)
polyfills.js:1 Failed to load resource: the server responded with a status of 404 (Not Found)
styles.js:1 Failed to load resource: the server responded with a status of 404 (Not Found)
scripts.js:1 Failed to load resource: the server responded with a status of 404 (Not Found)
main.js:1 Failed to load resource: the server responded with a status of 404 (Not Found)
vendor.js:1 Failed to load resource: the server responded with a status of 404 (Not Found)
main.js:1 Failed to load resource: the server responded with a status of 404 (Not Found)

当我尝试在[https://our site] / v4 / api / login的API中调用login方法时,我们得到此返回:

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
    <html>
        <head>
            <title>502 Proxy Error
        </head>
        <body>
            <h1>Proxy Error
            <p>The proxy server received an invalid response from an upstream 
     server.
                
The proxy server could not handle the request <em> <a href="/v4/api/login">POST /v4/api/login </em>. <p> Reason: <strong>Error reading from remote server </p> </p> </body> </html>

我们需要添加哪些重写规则才能使其工作?