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



Attachments
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://127.0.0.1/
* uwsgi:  -s 127.0.0.1:3031

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 127.0.0.1:0 (127.0.0.1) failed
[:error] [pid 35769:tid 34389522688] [client XXX.XXX.XXX.XXX:64938] AH10101: failed to make connection to backend: 127.0.0.1:0
- - - - - - -

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.