Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2009-02-28 18:49:40
- dijjal
- New Member
- Registered: 2009-02-28
- Posts: 5
TXP behind accelerator, logs not showing correct hosts
I’m trying to figure out how I can make Textpattern use the X-Forwarded-For data from traffic as all my traffic is passing through a varnish http accelerator. Right now all that is showing in the logs are the ip of the accelerator.
Any thoughts?
Last edited by dijjal (2009-02-28 19:04:40)
Offline
Re: TXP behind accelerator, logs not showing correct hosts
Actually, Textpattern contains code to detect proxies. Alas, it seems to be lacking in your context.
Please execute these steps to provide more information:
Create an article with this body contents:
= START =
<txp:php>
dmp('RA', serverSet('REMOTE_ADDR')).n;
dmp('SA', serverSet('SERVER_ADDR')).n;
dmp('FF', serverSet('HTTP_X_FORWARDED_FOR')).n;
</txp:php>
= END =
In this article’s “Advanced options”, set “Article markup” to “Leave text untouched”. Visit this article and report the body output between = START =
and = END =
.
Offline
#3 2009-03-11 20:15:57
- dijjal
- New Member
- Registered: 2009-02-28
- Posts: 5
Re: TXP behind accelerator, logs not showing correct hosts
Thanks for your reply! Sorry for the long delay, was expecting email notification of any replies.
This is the information it spits out:
= START =
RA 10.3.1.xx
SA 10.3.1.xx
FF 193.157.254.xxx
= END =
where the last bit of information is my correct IP. Promising I guess? :)
Offline
Re: TXP behind accelerator, logs not showing correct hosts
What version of Textpattern are you using?
Offline
#5 2009-03-12 11:45:21
- dijjal
- New Member
- Registered: 2009-02-28
- Posts: 5
Re: TXP behind accelerator, logs not showing correct hosts
4.0.7
Offline
Re: TXP behind accelerator, logs not showing correct hosts
Support for X-Forwarded-For was introduced in 4.0.7, so this is ok.
Is the proxy’s IP address recorded in the “host” or in the “ip” column (or both) of the log?
Offline
#7 2009-03-12 12:00:38
- dijjal
- New Member
- Registered: 2009-02-28
- Posts: 5
Re: TXP behind accelerator, logs not showing correct hosts
It’s recorded in both. IP address in IP column and hostname of the Varnish proxy in the host column. The hostname of the proxy is a local non-resolving one if it makes any difference.
Last edited by dijjal (2009-03-12 12:23:56)
Offline
Re: TXP behind accelerator, logs not showing correct hosts
I cannot reproduce your symptom, fwiw – everything looks so rosy. We’ll have to poke around a little bit more, I suspect.
- If this is a viable option,
TRUNCATE txp_log
and record another visit. - Set “Use DNS lookup in visitor logs?” to “No” in Preferences, and see whether it changes anything.
Offline