2014-01-09 100 views
4

我對Unix域套接字阿帕奇mod_proxy_uwsgi和UNIX域套接字

[uwsgi] 
... 
socket = /var/run/someuwsgi.sock 
socket = localhost:9987 
... 

的mod_proxy_uwsgi安裝

在Apache的配置運行uwsgi服務器有行: 的ProxyPass /一些uwsgi://本地主機:9987

它正在工作。

問題:apache配置線應該通過unix域套接字應該是什麼 /var/run/someuwsgi.sock ? 我試圖

ProxyPass /some uwsgi:///var/run/someuwsgi.sock 

,並得到

Bad Request 
Your browser sent a request that this server could not understand. 

也試過

ProxyPass /some uwsgi://unix:///var/run/someuwsgi.sock 

,並得到

Proxy Error 

The proxy server received an invalid response from an upstream server. 
The proxy server could not handle the request GET /some/. 

Reason: DNS lookup failure for: unix: 

謝謝!

回答

1

不幸的是,Apache代理API不(目前)支持Unix套接字

3

Starting from Apache 2.4.7,對於Unix套接字支持已被添加。語法非常簡單:

ProxyPass/unix:/tmp/uwsgi.sock|uwsgi:// 
+1

看起來好像它自2.4.7開始就是可用的。 http://httpd.apache.org/docs/trunk/en/mod/mod_proxy.html#proxypass – azmeuk