【问题标题】:Not able to access other folder rather than node.js app无法访问其他文件夹而不是 node.js 应用程序
【发布时间】:2019-05-21 12:13:01
【问题描述】:

我在端口 4000 上部署了一个 Angular 通用应用程序,并使用反向代理使其在端口 80 上运行。

应用程序路径:/var/html/www/eduglobe/eduglobe/(我以 domainname.com 访问此路径)

但我无法访问以下路径:/var/html/www/test/index.html(我无法在 domainname.com/test/index.html 访问)

php 和 node.js 服务器工作正常。

启用站点的 000-default.conf 的代码

    ProxyRequests Off


 <Proxy *>
    Order deny,allow
    Allow from all
</Proxy>

ServerName demo.eduglobe.in
DocumentRoot /var/www/html/eduglobe/eduglobe




<Location />
    ProxyPreserveHost On
    ProxyPass http://127.0.0.1:4000/
    ProxyPassReverse http://127.0.0.1:4000/
</Location>

【问题讨论】:

    标签: node.js apache2 angular-universal


    【解决方案1】:

    你启用了 proxy_http 吗?

    以下内容对我有用!

    检查 Location 指令是否指向托管应用程序的文件夹,该文件夹不是启用的站点的 DocumentRoot (/)。

    DocumentRoot /var/www/html/
    
    <Location /demo>
        ProxyPreserveHost On
        ProxyPass "http://127.0.0.1:8080/"
        ProxyPassReverse "http://127.0.0.1:8080/"
    </Location>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-06-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多