mod_proxy_uwsgi doesn't work with unix domain sockets
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
uwsgi (Debian) |
Fix Released
|
Unknown
|
|||
uwsgi (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
Xenial |
Fix Released
|
Medium
|
Unassigned |
Bug Description
= SRU =
== Impact ==
Using unix domain sockets for getting traffic from Apache to uwsgi is impossible. This is a regression from previous releases.
== Regression Potential ==
Patch is upstream, and that part of the codebase hasn't been touched since. Presumably that means it has been well tested by other uwsgi users.
It was also previously applied in the Debian/Ubuntu package. It was dropped by accident.
The patch only applies to the mod_proxy_uwsgi module, so no other bits of uwsgi should be affected (it does build *many* binaries and packages).
== Test Case ==
=== demo.conf ===
<VirtualHost *:80>
ServerName localhost
ProxyPass / unix:/run/
</VirtualHost>
=== demo.ini ===
[uwsgi]
plugin = python3
socket = /run/demo.sock
umask = 0111
wsgi-file = demo.py
=== demo.py ===
def application(env, start_response):
start_
return [b"Hello World"]
=== Steps ===
1. apt install apache2 libapache2-
2. a2enmod proxy_uwsgi
3. rm /etc/apache2/
4. cp demo.conf /etc/apache2/
5. service apache2 restart
lazy chroot option: (. /etc/apache2/
6. uwsgi --ini demo.ini
7. curl http://
Success: Hello World
Failure: A 502 Proxy Error, with this in the logs:
DNS lookup failure for: demo returned by /
= ORIGINAL REPROT =
If I specify "ProxyPass unix:/run/
The problem is fixed (at least for me) by the patch from the mailing list: http://
There is also a workaround: use "vanilla" mod_proxy_http over unix domain sockets:
ProxyPass "/foo" "unix:/
PS. Apparently, if you have multiple instances of uwsgi you want to connect to, you need to specify different names for them (ie. "http://
description: | updated |
Changed in uwsgi (Ubuntu): | |
status: | Confirmed → Fix Released |
Changed in uwsgi (Ubuntu Xenial): | |
importance: | Undecided → Medium |
status: | New → In Progress |
description: | updated |
description: | updated |
Changed in uwsgi (Debian): | |
status: | Unknown → Fix Released |
Forgot to specifty:
The server is a stock Ubuntu 15.04 server with all the software installed from the official repos. Ie: mod-proxy- uwsgi: 2.0.7-1ubuntu2
- apache2: 2.4.10-9ubuntu1.1
- apache2-mpm-event: 2.4.10-9ubuntu1.1
- libapache2-
- uwsgi: 2.0.7-1ubuntu2
- uwsgi-plugin-php: 2.0.7-1ubuntu2