configuring Apache on Mountain Lion proxying to Node.js

六眼飞鱼酱① 提交于 2019-12-13 06:18:11

问题


I'm trying to get Apache on OSX 10.8.2 to proxy requests to a specific URL to a Node.js server running on port 8080 following this guide: http://garrows.com/?p=455
In order to do this, I add the following to apache2/users/george.conf:

ProxyRequests Off
ProxyPass /foo http://localhost:8080
ProxyPassReverse /foo http://localhost:8080

But with this added, apache wont start. In fact, as soon as I add even the 'ProxyRequests Off' directive, apache will no longer start. Is this the right place for this directive?


回答1:


This works for me (I use port 3000 to connect to my own server here):

<Directory "/Users/psq/Sites/">
    Options Indexes MultiViews
    AllowOverride None
    Order allow,deny
    Allow from all

</Directory>

ProxyRequests Off
ProxyPass /foo http://localhost:3000
ProxyPassReverse /foo http://localhost:3000

But does not work if you place it inside <Directory>.

To debug, you can run:

sudo apachectl configtest

This will tell you where there is an error in your config.



来源:https://stackoverflow.com/questions/15149171/configuring-apache-on-mountain-lion-proxying-to-node-js

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!