Welcome! Log In Create A New Profile

Advanced

Re: Nginx forum returns 502 (2014-03-25T08:13Z)

All files from this thread

File Name File Size   Posted by Date  
http_exchange 1.2 KB open | download B.R. 03/25/2014 Read message
March 26, 2014 10:16AM
Hello,

On 3/26/14, 10:10 AM, Bruno Prémont wrote:
>
> Yeah, vanilla mod_rpaf-0.6 does not handle IPv6 addresses well.
>
> Be careful with the patch you choose, some fix the textual
> representation of REMOTE_ADDR but still break on Apache-side access
> control (e.g. on mis-match between proxy connection address family and
> header-passed address family).
>
> The patch I'm using successfully here is inlined below.
>
> Bruno
>
>
> ---
> diff -NurpP a/mod_rpaf.c b/mod_rpaf.c
> --- a/mod_rpaf.c 2014-02-17 09:21:08.278411786 +0100
> +++ b/mod_rpaf.c 2014-02-17 10:20:18.083940819 +0100
> @@ -173,6 +173,7 @@ static int change_remote_ip(request_rec
> }
>
> if (fwdvalue) {
> + apr_sockaddr_t *tmpsa;
> rpaf_cleanup_rec *rcr = (rpaf_cleanup_rec *)apr_pcalloc(r->pool, sizeof(rpaf_cleanup_rec));
> apr_array_header_t *arr = apr_array_make(r->pool, 0, sizeof(char*));
> while (*fwdvalue && (val = ap_get_token(r->pool, &fwdvalue, 1))) {
> @@ -184,7 +185,8 @@ static int change_remote_ip(request_rec
> rcr->r = r;
> apr_pool_cleanup_register(r->pool, (void *)rcr, rpaf_cleanup, apr_pool_cleanup_null);
> r->connection->remote_ip = apr_pstrdup(r->connection->pool, ((char **)arr->elts)[((arr->nelts)-1)]);
> - r->connection->remote_addr->sa.sin.sin_addr.s_addr = apr_inet_addr(r->connection->remote_ip);
> + if (apr_sockaddr_info_get(&tmpsa, r->connection->remote_ip, APR_UNSPEC, r->connection->remote_addr->port, 0, r->connection->remote_addr->pool) == APR_SUCCESS)
> + memcpy(r->connection->remote_addr, tmpsa, sizeof(apr_sockaddr_t));
> if (cfg->sethostname) {
> const char *hostvalue;
> if ((hostvalue = apr_table_get(r->headers_in, "X-Forwarded-Host"))) {
>
>

Thank you Bruno! I will try this a bit later, when things have settled
down here.

--
Jim Ohlstein


"Never argue with a fool, onlookers may not be able to tell the
difference." - Mark Twain

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Nginx forum returns 502 (2014-03-25T08:13Z)

B.R. March 25, 2014 04:16AM

Re: Nginx forum returns 502 (2014-03-25T08:13Z)

sarahnovotny March 25, 2014 10:30AM

Re: Nginx forum returns 502 (2014-03-25T08:13Z)

Jim Ohlstein March 25, 2014 11:34AM

Re: Nginx forum returns 502 (2014-03-25T08:13Z)

B.R. March 25, 2014 05:00PM

Re: Nginx forum returns 502 (2014-03-25T08:13Z) Attachments

B.R. March 25, 2014 05:00PM

Re: Nginx forum returns 502 (2014-03-25T08:13Z)

Jim Ohlstein March 25, 2014 05:18PM

Re: Nginx forum returns 502 (2014-03-25T08:13Z)

Jonathan Matthews March 25, 2014 06:52PM

Re: Nginx forum returns 502 (2014-03-25T08:13Z)

Jim Ohlstein March 26, 2014 09:24AM

Re: Nginx forum returns 502 (2014-03-25T08:13Z)

B.R. March 26, 2014 09:58AM

Re: Nginx forum returns 502 (2014-03-25T08:13Z)

Bruno Prémont March 26, 2014 10:12AM

Re: Nginx forum returns 502 (2014-03-25T08:13Z)

Jim Ohlstein March 26, 2014 10:16AM

Re: Nginx forum returns 502 (2014-03-25T08:13Z)

Jim Ohlstein March 26, 2014 10:12AM

Re: Nginx forum returns 502 (2014-03-25T08:13Z)

itpp2012 March 26, 2014 10:02AM

Re: Nginx forum returns 502 (2014-03-25T08:13Z)

Jim Ohlstein March 26, 2014 10:18AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 242
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready