【问题标题】:How to establish a Apache2 proxy for a localhost:3000 node.js based application如何为基于 localhost:3000 node.js 的应用程序建立 Apache2 代理
【发布时间】:2019-06-19 04:23:04
【问题描述】:

我正试图弄清楚如何将我在 AWS Lightsail 上运行的 Apache2 服务器链接到我正在使用的应用程序,该应用程序在激活时使用 http://localhost:3000 — 它是一个简单的基于 Node.js 的 CMS,称为 Vapid。我将服务器链接到我的域名 - bigsheepcollective.com - 我可以让 Vapid 通过 AWS 终端运行,但它只是 Apache2 登录页面显示在我的域名上。我看到了一个教程here,它介绍了在运行 Nginx 的服务器上建立代理通道,但我不确定如何为使用 Apache2 的服务器做同样的事情。

我尝试过使用 Nginx 教程,也没有对 Apache2 的代理设置进行大量搜索,但是在运行使用 http 的应用程序时我需要哪种类型的代理感到困惑//:本地主机:3000.

【问题讨论】:

    标签: proxy localhost apache2 bitnami vapid


    【解决方案1】:

    您好,这里是 Bitnami 工程师。

    您可以将这些行包含在 /opt/bitnami/apache2/conf/bitnami/bitnami.conf 文件或您为应用程序创建的特定 .conf 文件中

    ProxyPass / http://127.0.0.1:3000/
    ProxyPassReverse / http://127.0.0.1:3000/
    

    这样,您将在访问实例的公共 IP 或其关联域时访问您的应用程序。

    我们文档中的本指南解释了在 Bitnami 之上配置 Node.js 应用程序的整个过程。

    https://docs.bitnami.com/aws/infrastructure/mean/administration/create-custom-application-nodejs/

    【讨论】:

    • 成功了!谢谢比特纳米人!!添加了这个,然后通过 pm2 start pm2.json 启动 Vapid。
    猜你喜欢
    • 2019-03-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-04-02
    • 1970-01-01
    • 2019-07-07
    • 1970-01-01
    • 2011-08-30
    相关资源
    最近更新 更多