问题描述
我试图字preSS融入其中启用apache httpd的端口转发服务器的NodeJS上运行我的网站从80端口端口的NodeJS 9000我已经安装了字preSS到转发所有的请求阿帕奇的httpd /网络/博客的文件夹。
I am trying to integrate wordpress into my site which is running on Nodejs server with Apache Httpd port forwarding enabled to forward all the request from 80 port to Nodejs port 9000. I have installed wordpress into Apache httpd /www/blog folder.
现在,我想修改我的httpd.conf让我所有的客户机的请求仍然应该被转发到服务器的NodeJS但不应该转发代理我的blog.example.com电话,他们应该指向/ WWW /博客的文件夹。这可能吗 ?
Now, i want to edit my httpd.conf so that all my requests coming from client should still be forwarded to nodejs server except my blog.example.com calls which should not be proxy forwarded and they should point to /www/blog folder. Is this possible ?
下面是httpd.conf中的虚拟主机code: -
Here is the Virtualhost code from httpd.conf :-
<VirtualHost *:80>
ProxyPreserveHost On
ProxyPass / http://localhost:9000/
ProxyPassReverse / http://localhost:9000/
ServerName example.com
</VirtualHost>
任何帮助将是AP preciated。
Any help would be appreciated.
推荐答案
这为我工作。可能是一些帮助别人。
This worked for me. Might be of some help for others.
<VirtualHost *:80>
RewriteEngine on
RewriteCond %{HTTP_HOST} ^blog\.example\.com
RewriteRule ^(.*)$ http://www\.example\.com/blog/$1 [L]
ProxyPreserveHost On
ProxyPass /blog !
ProxyPass / http://localhost:9000/
ProxyPassReverse / http://localhost:9000/
ServerName example.com
</VirtualHost>
这篇关于在Apache选择性的代理端口转发的httpd的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!