×

Notice

The forum is in read only mode.
Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC: Behind squid http accel registers all comments with 127.0.0.1

Behind squid http accel registers all comments with 127.0.0.1 15 years 2 months ago #6408

  • Mario Medina
  • Mario Medina's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 6
  • Thank you received: 0
You should add an option to the code that detects or that can be configurable for this. When the site is behind a squid proxy/cache that acts as web accel the IP that comes with REMOTE_ADDR is the squid server IP, and it should be another varible, HTTP_X_FORWARDED_FOR.

This variable also can contain more than one IP, like 1.2.3.4,127.0.0.1 if the user is using also a proxy/cache.

I don't know if the IP is used by akismet, but if it is used, then on sites like mine, with http accel infront, akismet doesn't work very well.

Thanks :)

Behind squid http accel registers all comments with 127.0.0.1 15 years 2 months ago #6451

  • JonusC
  • JonusC's Avatar
  • Offline
  • Platinum Boarder
  • Platinum Boarder
  • Posts: 785
  • Thank you received: 48
I've actually thought about this, I came across this when I was experiencing massive delays on Gravatar loading when I was behind a proxy - I found that PHP was trying over and over to use a direct connection that didn't exist. I don't know if that's related, but I was investigating all this stuff not long ago - and to be honest I have no idea how to do it.

We'll see what Daniel thinks on this.

Behind squid http accel registers all comments with 127.0.0.1 15 years 2 months ago #6479

  • Mario Medina
  • Mario Medina's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 6
  • Thank you received: 0
I think is easy to fix the problem with httpd accel, only check if is set _SERVER[HTTP_X_FORWARDED_FOR]. Or maybe an option, a checkbox that says "I'm behind a httpd accel (squid or other)" and if this checkbox is checked, then the HTTP_X_FORWARDED_FOR is used instead of REMOTE_ADDR.
  • Page:
  • 1
Time to create page: 0.099 seconds