1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XF 1.4 Undefined index: HTTP_X_REAL_IP

Discussion in 'XenForo Questions and Support' started by clove28, Jul 31, 2015.

  1. clove28

    clove28 Active Member

    I received this server error. What does this mean?

    Code:
    ErrorException: Undefined index: HTTP_X_REAL_IP - library/config.php:36
    
    Generated By: Unknown Account, Today at 4:05 PM
    
    Stack Trace
    
    #0 /pefcommunity.com/public/library/config.php(36): XenForo_Application::handlePhpError(8, 'Undefined index...', '/home/nginx/dom...', 36, Array)
    
    #1 /pefcommunity.com/public/library/XenForo/Application.php(616): require('/home/nginx/dom...')
    
    #2 /pefcommunity.com/public/library/XenForo/Application.php(265): XenForo_Application->loadConfig()
    
    #3 /pefcommunity.com/public/library/XenForo/Install/Controller/Abstract.php(10): XenForo_Application->loadDefaultData()
    
    #4 /pefcommunity.com/public/library/XenForo/Controller.php(304): XenForo_Install_Controller_Abstract->_preDispatchFirst('Login')
    
    #5 /pefcommunity.com/public/library/XenForo/FrontController.php(346): XenForo_Controller->preDispatch('Login', 'XenForo_Install...')
    
    #6 /pefcommunity.com/public/library/XenForo/FrontController.php(134): XenForo_FrontController->dispatch(Object(XenForo_RouteMatch))
    
    #7 /pefcommunity.com/public/install/index.php(18): XenForo_FrontController->run()
    
    #8 {main}
    
    
     
  2. Chris D

    Chris D XenForo Developer Staff Member

    That's on line 36 of your config.php file so it would suggest that you have added that yourself.
     
    clove28 and MattW like this.
  3. imthebest

    imthebest Formerly Super120

    Are you trying to configure Cloudflare or something like that?
     
  4. MattW

    MattW Well-Known Member

    This is what he's set (along with the Cloudflare stuff)
    PHP:
    // FIX IP ADDRESS FOR PROXY
    $_SERVER['REMOTE_ADDR'] = $_SERVER['HTTP_X_REAL_IP'];
     
    clove28 likes this.
  5. MattW

    MattW Well-Known Member

    Although, nginx is already configured for Cloudflare
    Code:
    #CloudFlare
    set_real_ip_from 199.27.128.0/21;
    set_real_ip_from 173.245.48.0/20;
    set_real_ip_from 103.21.244.0/22;
    set_real_ip_from 103.22.200.0/22;
    set_real_ip_from 103.31.4.0/22;
    set_real_ip_from 141.101.64.0/18;
    set_real_ip_from 108.162.192.0/18;
    set_real_ip_from 190.93.240.0/20;
    set_real_ip_from 188.114.96.0/20;
    set_real_ip_from 197.234.240.0/22;
    set_real_ip_from 198.41.128.0/17;
    set_real_ip_from 162.158.0.0/15;
    set_real_ip_from 104.16.0.0/12;
    set_real_ip_from 172.64.0.0/13;
    real_ip_header CF-Connecting-IP;
     
    clove28 likes this.
  6. clove28

    clove28 Active Member

    Thanks a lot Matt! So can I safely removed that line?
     
  7. MattW

    MattW Well-Known Member

    Yeah, and the cloudflare line below it
     
    clove28 likes this.
  8. clove28

    clove28 Active Member

    Alright Matt. Thank you! :)
     
  9. AndyB

    AndyB Well-Known Member

    I found this very useful for web hosting that uses nginx.
     

Share This Page