listener [ANY] problem

#1
OS: Centos 6 x86_64
Litespeed: Litespeed Web Server Enterprise v4.2.1 without apache/panels
When we configure listener to accept ipv4 and ipv6 connections in php in SERVER_ADDR ipv4 display as ::ffff:XX.XX.XX.XX some client has errors when adding ::ffff: before ipv4.
If adding 2 listener for ipv4 and ipv6 - need duplicate vhost - this is unacceptable
How we can resolve this issue? For nginx this fix easy:
Code:
set $remote_addr_new $remote_addr;
if ($remote_addr ~* ^::ffff:(.*))
{
 set $remote_addr_new $1;
}
 
fastcgi_param   REMOTE_ADDR        $remote_addr_new;
 

NiteWave

Administrator
#2
set up 2 listeners, one is ipv4, one is ipv6, but map to same vhost.

just tested on an production server which run lsws, it works.

please try, any issue please report back.
 

NiteWave

Administrator
#4
must configure in above way.

for this part:
Code:
set $remote_addr_new $remote_addr;
if ($remote_addr ~* ^::ffff:(.*))
{
 set $remote_addr_new $1;
}
 
fastcgi_param   REMOTE_ADDR        $remote_addr_new;
may be able to use rewriterule to archive similar purpose:

Code:
RewriteCond %{REMOTE_ADDR} ^::ffff:(.*)$
RewriteRule (.*) - [E=REMOTE_ADDR:%1]
 

mistwang

LiteSpeed Staff
#8
REMOTE_ADDR has been converted to IPv4 format automatically without using the rewrite rule.
SERVER_ADDR was not converted to IPv4, will fix that in 4.2.3 release.
 
Top