Bug 69235 - unable to connect to backend with existing rewrite rules.
Summary: unable to connect to backend with existing rewrite rules.
Status: NEW
Alias: None
Product: Apache httpd-2
Classification: Unclassified
Component: mod_rewrite (show other bugs)
Version: 2.4.62
Hardware: PC All
: P2 critical (vote)
Target Milestone: ---
Assignee: Apache HTTPD Bugs Mailing List
URL:
Keywords: FixedInTrunk, PatchAvailable
: 69260 (view as bug list)
Depends on:
Blocks:
 
Reported: 2024-07-31 15:10 UTC by venki
Modified: 2024-09-11 16:01 UTC (History)
0 users



Attachments
mod_proxy fixup after mod_rewrite's (3.28 KB, patch)
2024-07-31 16:57 UTC, Yann Ylavic
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description venki 2024-07-31 15:10:27 UTC

    
Comment 1 venki 2024-07-31 15:16:56 UTC
The below rewrite rule worked till 2.4.61.
<LocationMatch ^/(Applications)>
 RewriteEngine On
 RewriteRule (.*) unix:/run/fcgirds/fcgirds.socket|fcgi://localhost/ [P,NE]
</LocationMatch>

stopped working from 2.4.62 onwards and the facing below issues.

[Wed Jul 31 20:30:02.945378 2024] [proxy_fcgi:debug] [pid 16403:tid 16416] mod_proxy_fcgi.c(1078): [client 10.107.40.71:57512] AH01076: url: unix:/var/lib/fcgirds/fcgirds.socket|fcgi://localhost/ proxyname: (null) proxyport: 0
[Wed Jul 31 20:30:02.945407 2024] [proxy_fcgi:debug] [pid 16403:tid 16416] mod_proxy_fcgi.c(1083): [client 10.107.40.71:57512] AH01077: declining URL unix:/var/lib/fcgirds/fcgirds.socket|fcgi://localhost/

Generally, in working case, the URI is fcgi://localhost/

Could you pls suggest how to address this issue.
Comment 2 Yann Ylavic 2024-07-31 16:57:10 UTC
Created attachment 39832 [details]
mod_proxy fixup after mod_rewrite's

Could you please try this patch?
Comment 3 venki 2024-08-01 14:25:42 UTC
Thanks for sharing the patch.

I have tested with the provided patch and its working fine.
Comment 4 venki 2024-08-01 15:46:53 UTC
Observing Content-Length missing from the client side for the cgi login requests.

Searching for Content-Length field...
Searching for Content-length field because Content-Length was not found
Failed to find Content-Length field in HTTP headers!! 

Does any Content-Length strip off for the cgi requests?
Comment 5 Eric Covener 2024-08-01 15:52:41 UTC
(In reply to venki from comment #4)
> Observing Content-Length missing from the client side for the cgi login
> requests.
> 
> Searching for Content-Length field...
> Searching for Content-length field because Content-Length was not found
> Failed to find Content-Length field in HTTP headers!! 
> 
> Does any Content-Length strip off for the cgi requests?

sounds like https://httpd.apache.org/docs/2.4/env.html#cgilike
Comment 6 venki 2024-08-01 16:08:58 UTC
Keep-Alive: timeout=60, max=100
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: text/xml

Transfer-Encoding is Chunked.
Comment 7 venki 2024-08-01 17:04:10 UTC
this particular configuration "SetEnv ap_trust_cgilike_cl 1" fixed the issue for the content-length issue.

Does above provided patch will be available in next Apache version?
Comment 8 venki 2024-08-13 10:17:51 UTC
I am observing one more observing. Tried this https://ip/dtapi?$select=Id URIs and seeing some difference in the previous versions and 2.4.62 version. 

its not connected(connected /dtapi?$select=Id to httpd-UDS:0) in the Apache 2.4.62 version.

2.4.62 logs:
------------
[Tue Aug 13 17:51:36.179146 2024] [proxy:debug] [pid 8110:tid 8145] proxy_util.c(3242): [client 100.71.132.107:61652] AH00944: connecting http://localhost/dtapi%3F$select=Id?$select=Id to localhost:80
[Tue Aug 13 17:51:36.179271 2024] [proxy:debug] [pid 8110:tid 8145] proxy_util.c(3309): [client 100.71.132.107:61652] AH02545: http: has determined UDS as /run/telemetryservice/http.socket (for localhost:80)
[Tue Aug 13 17:51:36.179402 2024] [proxy:debug] [pid 8110:tid 8145] proxy_util.c(3450): [client 100.71.132.107:61652] AH00947: connecting /dtapi%3F$select=Id?$select=Id to ?:0 (localhost:80)
[Tue Aug 13 17:51:36.180769 2024] [proxy:debug] [pid 8110:tid 8145] proxy_util.c(3832): AH02823: http: connection established with Unix domain socket /run/telemetryservice/http.socket (localhost:80)
[Tue Aug 13 17:51:36.180940 2024] [proxy:debug] [pid 8110:tid 8145] proxy_util.c(4144): AH00962: http: connection complete to ?:0 (localhost)

------------------------------
previous Apache version logs:
------------------------------
[Tue Aug 13 15:09:26.940937 2024] [proxy:debug] [pid 8197:tid 2787111856] proxy_util.c(2588): [client 100.71.132.107:60182] AH00944: connecting http://localhost/dtapi?$select=Id to localhost:80
[Tue Aug 13 15:09:26.940974 2024] [proxy:debug] [pid 8197:tid 2787111856] proxy_util.c(2624): [client 100.71.132.107:60182] AH02545: http: has determined UDS as /run/telemetryservice/http.socket
[Tue Aug 13 15:09:26.941917 2024] [proxy:debug] [pid 8197:tid 2787111856] proxy_util.c(2811): [client 100.71.132.107:60182] AH00947: connected /dtapi?$select=Id to httpd-UDS:0
[Tue Aug 13 15:09:26.942712 2024] [proxy:debug] [pid 8197:tid 2787111856] proxy_util.c(3178): AH02823: http: connection established with Unix domain socket /run/telemetryservice/http.socket (*)
[Tue Aug 13 15:09:26.942932 2024] [proxy:debug] [pid 8197:tid 2787111856] proxy_util.c(3463): AH00962: http: connection complete to 0.0.0.0:0 (httpd-UDS)
Comment 9 Ruediger Pluem 2024-08-22 09:24:06 UTC
Please try the additional patch from PR 69260 (https://bz.apache.org/bugzilla/attachment.cgi?id=39842&action=diff) on top of the patch provided here.
Comment 10 Ruediger Pluem 2024-09-11 15:59:27 UTC
Committed to trunk as r1920570 and r1920571.
Comment 11 Ruediger Pluem 2024-09-11 16:01:10 UTC
*** Bug 69260 has been marked as a duplicate of this bug. ***