listener [ANY] problem

Discussion in 'General' started by dims, May 15, 2013.

  1. dims

    dims New Member

    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;
  2. NiteWave

    NiteWave Administrator

    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.
  3. dims

    dims New Member

    Yes, we think about this, but maybe have other way?
  4. NiteWave

    NiteWave Administrator

    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]
  5. dims

    dims New Member

    Can we set this globally for all domains?
  6. dims

    dims New Member

    This work for remote_addr, but dont work for _SERVER["SERVER_ADDR"]
  7. dims

    dims New Member

    we ready pay for patch sapi litespeed where will be fixed :ffff: in server_addr
  8. mistwang

    mistwang LiteSpeed Staff

    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.
  9. dims

    dims New Member

    can tell a release date for 4.2.3?
  10. webizen

    webizen New Member

    In about a week or so.

Share This Page