Confirming that the patch below works (tested both unix and tcp socket after it was applied).

Until it gets committed / it makes its way into Debian / Ubuntu, I'll use the following workaround:

- change "socket" to "http-socket" in the uwsgi.ini
- use mod_proxy_http instead of mod_proxy_uwsgi:

ProxyPass "/foo" "unix:/var/run/uwsgi/foo.socket|http://uwsgi-uds-foo/";

Cheers!
Attila
Hi,

With the below patch and the following line in apache, it seems to
work. I will follow up if I can confirm this and test it still works
with TCP.

ProxyPass "/foo"  "unix:/var/run/uwsgi/foo.socket|uwsgi://uwsgi-uds-foo/"

Note: I use uwsgi-uds-foo as hostname instead of localhost because if
you have multiple entrie like these in the same apache conf, apache
thinks it is the same backend even though the unix socket path is
different. So it is mandatory to use different hostnames if you have
multiple app sockets.

Thanks,

Alex

--- uwsgi-2.0.7/apache2/mod_proxy_uwsgi.c       2014-09-05
06:48:15.000000000 +0200
+++ uwsgi-2.0.7.new/apache2/mod_proxy_uwsgi.c   2015-09-23
14:51:16.317165714 +0200
@@ -67,20 +67,18 @@
      }
      url += sizeof(UWSGI_SCHEME); /* Keep slashes */

-    // is it a unix socket ?
-    if (strlen(url) == 2) {
-       *sport = 0;
-    }
-    else {
-        err = ap_proxy_canon_netloc(r->pool, &url, NULL, NULL, &host, &port);
-        if (err) {log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
-                      "error parsing URL %s: %s", url, err);
-            return HTTP_BAD_REQUEST;
-        }
-       apr_snprintf(sport, sizeof(sport), ":%u", port);
+    err = ap_proxy_canon_netloc(r->pool, &url, NULL, NULL, &host, &port);
+    if (err) {
+        ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
+                    "error parsing URL %s: %s", url, err);
+        return HTTP_BAD_REQUEST;
      }

+    if (port != UWSGI_DEFAULT_PORT)
+        apr_snprintf(sport, sizeof(sport), ":%u", port);
+    else
+        sport[0] = '\0';
+
      if (ap_strchr(host, ':')) { /* if literal IPv6 address */
          host = apr_pstrcat(r->pool, "[", host, "]", NULL);
      }
_______________________________________________
uWSGI mailing list
[email protected]
http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi

_______________________________________________
uWSGI mailing list
[email protected]
http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi

Reply via email to