Welcome! Log In Create A New Profile

Advanced

[PATCH] fastcgi_params: added REMOTE_HOST parameter

Jakub Zelenka
January 12, 2024 12:06PM
Hi,

I'm a PHP-FPM maintainer and some FPM users have issues with missing host
header when using HTTP/3: https://github.com/php/php-src/issues/13021 .
This is not an nginx issue as correctly noted in
https://trac.nginx.org/nginx/ticket/2281 but it would be nice to have
fastcgi_param set for getting host in default config. I was thinking how to
best expose $host and REMOTE_HOST seems logical and so I think it could be
useful addition. I can update FPM to also set REMOTE_HOST from HTTP_HOST if
REMOTE_HOST is not set which would make it even more available for HTTP/1.1
and HTTP/2 users.

Please let me know what you think!

# HG changeset patch
# User Jakub Zelenka <bukka@php.net>
# Date 1705078404 0
# Fri Jan 12 16:53:24 2024 +0000
# Node ID 1ff2f737bd318a730d0944a6037c8fd7c7da2656
# Parent ee40e2b1d0833b46128a357fbc84c6e23be9be07
Added REMOTE_HOST parameter to fastcgi_params.

When HTTP/3 is used, users will no longer get HTTP_HOST as host header is no
longer set by most clients. It is useful / necessary for many setups to have
such information and REMOTE_HOST is defined in CGI/1.1 for such purpose.

diff -r ee40e2b1d083 -r 1ff2f737bd31 conf/fastcgi_params
--- a/conf/fastcgi_params Mon Dec 25 21:15:48 2023 +0400
+++ b/conf/fastcgi_params Fri Jan 12 16:53:24 2024 +0000
@@ -17,6 +17,7 @@

fastcgi_param REMOTE_ADDR $remote_addr;
fastcgi_param REMOTE_PORT $remote_port;
+fastcgi_param REMOTE_HOST $host;
fastcgi_param SERVER_ADDR $server_addr;
fastcgi_param SERVER_PORT $server_port;
fastcgi_param SERVER_NAME $server_name;
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
https://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[PATCH] fastcgi_params: added REMOTE_HOST parameter

Jakub Zelenka 208 January 12, 2024 12:06PM

Re: [PATCH] fastcgi_params: added REMOTE_HOST parameter

Maxim Dounin 41 January 12, 2024 05:22PM

Re: [PATCH] fastcgi_params: added REMOTE_HOST parameter

Jakub Zelenka 39 January 12, 2024 06:06PM

Re: [PATCH] fastcgi_params: added REMOTE_HOST parameter

Maxim Dounin 54 January 12, 2024 10:16PM

Re: [PATCH] fastcgi_params: added REMOTE_HOST parameter

Jakub Zelenka 50 January 17, 2024 08:38AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 214
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready