Bug 64405 - Define default port for uwsgi scheme.
Summary: Define default port for uwsgi scheme.
Status: NEW
Alias: None
Product: Apache httpd-2
Classification: Unclassified
Component: mod_proxy_uwsgi (show other bugs)
Version: 2.4.43
Hardware: PC All
: P2 normal (vote)
Target Milestone: ---
Assignee: Apache HTTPD Bugs Mailing List
Keywords: PatchAvailable
Depends on:
Reported: 2020-05-03 08:08 UTC by Norikatsu Shigemura
Modified: 2020-11-01 11:18 UTC (History)
0 users

patch for define default uwsgi port (2.32 KB, patch)
2020-05-03 08:08 UTC, Norikatsu Shigemura
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Norikatsu Shigemura 2020-05-03 08:08:14 UTC
Created attachment 37214 [details]
patch for define default uwsgi port

In following setting:
* apache: ProxyPass / uwsgi://
* uwsgi:  -s

I got a following error in error_log:
- - - - - - -
[proxy:error] [pid 35769:tid 34389522688] (49)Can't assign requested address: AH00957: uwsgi: attempt to connect to ( failed
[:error] [pid 35769:tid 34389522688] [client XXX.XXX.XXX.XXX:64938] AH10101: failed to make connection to backend:
- - - - - - -

Because pschemes[] array doesn't have a information of uwsgi's default port.
So ap_proxy_port_of_scheme() returns 0.

static proxy_schemes_t pschemes[] =
    {"fcgi",     8000},
    {"ajp",      AJP13_DEF_PORT},
    {"scgi",     SCGI_DEF_PORT},
    {"h2c",      DEFAULT_HTTP_PORT},
    {"h2",       DEFAULT_HTTPS_PORT},
    {"ws",       DEFAULT_HTTP_PORT},
    {"wss",      DEFAULT_HTTPS_PORT},
    { NULL, 0xFFFF }     /* unknown port */

To fix above issue, please add a definition like attached patch.