阿帕奇mod_proxy_uwsgi和UNIX域套接字 [英] Apache mod_proxy_uwsgi and unix domain sockets

查看:496
本文介绍了阿帕奇mod_proxy_uwsgi和UNIX域套接字的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对Unix域套接字运行uwsgi服务器

I have a uwsgi server running for unix domain socket

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

安装的mod_proxy_uwsgi

The mod_proxy_uwsgi is installed

在Apache的配置有一行:
    的ProxyPass /一些uwsgi://本地主机:9987

In apache config has that line: ProxyPass /some uwsgi://localhost:9987

和它工作。

问:什么应该是Apache的配置线要经过Unix域套接字
   /var/run/someuwsgi.sock

我试过

Question: what should be the apache config line to go through unix domain socket /var/run/someuwsgi.sock ? I tried

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:

谢谢!

推荐答案

来自Apache 2.4.7 的开始,对于Unix套接字支持已被添加。语法是pretty简单:

Starting from Apache 2.4.7, support for Unix sockets has been added. The syntax is pretty simple:

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

这篇关于阿帕奇mod_proxy_uwsgi和UNIX域套接字的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆