简体   繁体   English

如何为基于localhost:3000 node.js的应用程序建立Apache2代理

[英]How to establish a Apache2 proxy for a localhost:3000 node.js based application

I'm trying to figure out how to link my Apache2 server running on AWS Lightsail to an application I'm housing that uses http://localhost:3000 when activated—it's a simple Node.js based CMS called Vapid. 我试图弄清楚如何将我在AWS Lightsail上运行的Apache2服务器链接到我所容纳的应用程序,该应用程序在激活时使用http:// localhost:3000 —这是一个简单的基于Node.js的CMS,称为Vapid。 I have the server linked to my domain name—bigsheepcollective.com—and I can get Vapid running through the AWS terminal, but it's only the Apache2 landing page that shows up on my domain name. 我已经将服务器链接到我的域名bigsheepcollective.com,并且可以通过AWS终端运行Vapid,但只有Apache2登录页面显示在我的域名上。 I saw a tutorial here that goes over establishing a proxy pass on an Nginx ran server but I'm not sure how to do the same thing for one using Apache2. 我在这里看到了一个教程,该教程介绍如何在Nginx运行服务器上建立代理传递,但是我不确定如何使用Apache2对一个人执行相同的操作。

I've tried using the Nginx tutorial and I've also don't some extensive searches into proxy setups for Apache2, but I'm confused about what type of proxy I need when it comes to running an application that uses http//:localhost:3000. 我尝试使用Nginx教程,也没有对Apache2的代理设置进行大量搜索,但是对于运行使用http //的应用程序时我需要哪种类型的代理感到困惑:本地主机:3000。

Hi Bitnami Engineer here. 您好Bitnami工程师在这里。

You can include these lines in the /opt/bitnami/apache2/conf/bitnami/bitnami.conf file or in the specific .conf file you created for your application 您可以在/opt/bitnami/apache2/conf/bitnami/bitnami.conf文件或为应用程序创建的特定.conf文件中包含这些行。

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

This way you will access your application when accessing the public IP of your instance or its associated domain. 这样,您将在访问实例或其关联域的公共IP时访问应用程序。

This guide in our documentation explains the whole process to configure a Node.js application on top of Bitnami. 我们文档中的本指南介绍了在Bitnami之上配置Node.js应用程序的整个过程。

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM