Results 1 to 7 of 7
  1. #1
    Join Date
    Oct 2005
    Posts
    287
    Plugin Contributions
    0

    help question Implement the X-Forwarded-For header

    We use Google Page Speed Service to speed up our website.

    Can one please suggest how to implement the X-Forwarded-For header on the website, both catlog and admin side.

    We have done this on server level, but still finding issues.

    Thanks

  2. #2
    Join Date
    Jan 2004
    Posts
    66,450
    Plugin Contributions
    81

    Default Re: Implement the X-Forwarded-For header

    What specific problem are you encountering?
    What ZC version are you using?
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  3. #3
    Join Date
    Oct 2005
    Posts
    287
    Plugin Contributions
    0

    Default Re: Implement the X-Forwarded-For header

    After enabling Google PSS for some pages we get the below message
    "
    "Fetching of original content failed with the following error: Proxy Publisher Failure - NO RESPONSE. If you own this domain, please consult this FAQ."
    "

    The link to the above FAQ is: http://code.google.com/speed/pss/faq...blisherfailure

    We were also told:

    =============

    We suspect that some of the requests from PSS are not handled correctly by your origin servers because they are seeing a large number of requests coming from a small set of IP addresses (Google's PSS servers).

    To fix this situation, we recommend configuring your origin server to read the IP address of the user from the "X-Forwarded-For" HTTP header, rather than the default set up. You can read more about implementing the X-Forwarded-For header at https://developers.google.com/speed/...s/faq#clientip

    ===========

    We have setup the X-Forwarded_For at server level, still we face this issue hence we were told to test at script level

    Thanks
    Harry

  4. #4
    Join Date
    Jan 2004
    Posts
    66,450
    Plugin Contributions
    81

    Default Re: Implement the X-Forwarded-For header

    Zen Cart already uses x_forwarded_for, if it's available:

    Code:
    function zen_get_ip_address() {
      if (isset($_SERVER)) {
        if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {
          $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
    ...
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  5. #5
    Join Date
    Oct 2005
    Posts
    287
    Plugin Contributions
    0

    Default Re: Implement the X-Forwarded-For header

    Thanks Dr Byte, nice to know it already exists and for your wonderful help.

    By "if it's available:" , do you mean if a proxy feature is being used, Zencart automatically passes the actual Ip's

  6. #6
    Join Date
    Jan 2004
    Posts
    66,450
    Plugin Contributions
    81

    Default Re: Implement the X-Forwarded-For header

    By "if it's available", I mean: if the webserver software (ie: Apache, etc) is passing the $_SERVER variable to PHP, and that $_SERVER array contains the HTTP_X_FORWARDED_FOR element, it will assume that your apache server is passing the real IP via that variable, and then Zen Cart will use that for the IP address instead of the usual REMOTE_ADDR value.
    It's all dependent on your webserver being correctly configured with your proxy server ... so it's up to your network administrator to properly configure your proxy server and your apache webserver.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  7. #7
    Join Date
    Oct 2005
    Posts
    287
    Plugin Contributions
    0

    Default Re: Implement the X-Forwarded-For header

    Thanks Dr Byte, this clarifies all.
    Made a script which proves we are passing the real IP on the server ,
    Zen Cart already uses x_forwarded_for, it's available at our server.
    Will pass it to the Google guys .
    PSS is still in beta probably the reason for the issues.
    Regards

 

 

Similar Threads

  1. v151 Not forwarded to the banner url
    By garden in forum Basic Configuration
    Replies: 3
    Last Post: 2 Jan 2014, 07:31 AM
  2. Implement Memcached for speedup site?
    By Webmart in forum All Other Contributions/Addons
    Replies: 8
    Last Post: 2 Jan 2013, 07:37 PM
  3. Interesting idea I'm trying to implement for the sales section
    By Rickwilliams in forum General Questions
    Replies: 7
    Last Post: 14 Apr 2010, 09:09 AM
  4. How to implement an external stylesheet for my menu?
    By zingslings in forum Templates, Stylesheets, Page Layout
    Replies: 8
    Last Post: 27 Apr 2009, 11:53 PM
  5. best way to implement captcha for contact-us form??
    By tlyczko in forum General Questions
    Replies: 2
    Last Post: 14 Apr 2008, 05:13 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg