1

我的服务器在 apache 上运行,但Ghost需要托管 node.js。我网站的其余部分在 apache 上运行。如何让它在我网站的子域上运行而不干扰其他应用程序?

4

3 回答 3

1

您可以重写 url 以重定向到 nodejs-app 的端口:

RewriteEngine On
RewriteRule ^nodeapp/(.*) http://localhost:3000/$1 [P]

如果您的应用程序从端口 3000 开始,您可以通过以下方式访问它:http ://www.your-domain.com/nodeapp/ ...

于 2013-12-17T16:08:22.543 回答
0

Use apache mod proxy.

Setup your virtual host configuration to proxypass it to the port which ghost is listening on.

于 2013-12-13T17:31:23.913 回答
0

使用 mod 代理将是一个不错的选择。这是一个小模板:

NameVirtualHost *:80
<VirtualHost *:80>
     ServerName your-url.com
     ServerAlias www.your-url.com
     ProxyRequests off
     ProxyPass / http://127.0.0.1:2368/
     ProxyPassReverse / http:/127.0.0.1:2368/
</VirtualHost>

但是如果你之前没有使用过代理模式,请a2enmod proxy在重启你的 Appache 服务之前使用这个命令:

于 2014-03-20T00:54:27.760 回答