我有一个为 unix 域套接字运行的 uwsgi 服务器
[uwsgi]
...
socket = /var/run/someuwsgi.sock
socket = localhost:9987
...
mod_proxy_uwsgi 已安装
在 apache 配置中有这样一行: ProxyPass/一些 uwsgi://localhost:9987
它正在工作。
问题:通过 unix 域套接字的 apache 配置行应该是什么 /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:
谢谢!
最佳答案
Starting from Apache 2.4.7 ,添加了对 Unix 套接字的支持。语法非常简单:
ProxyPass / unix:/tmp/uwsgi.sock|uwsgi://
关于Apache mod_proxy_uwsgi 和 unix 域套接字,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21019717/