Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a Ubuntu Lucid server with Nginx (0.7.65) and php5-fpm (package by Brian Mercer)

All my configuration is default and my site config is looking like this (domains replaced):

server {
  listen 80;
  server_name sub.example.com;
  access_log /data/log/www/sub.example.com/access.log;
  error_log /data/log/www/sub.example.com/error.log;

  location / {
    root /data/www_data/sub.example.com/public;
    index index.php;
  }

  location ~ \.php$ {
    fastcgi_param SCRIPT_FILENAME /data/www_data/sub.example.com/public$fastcgi_script_name;
    fastcgi_pass 127.0.0.1:9000;
    include /etc/nginx/fastcgi_params;
  }
}

And I have an index.php present with <?php phpinfo(); ?> in it.

Now when I load sub.example.com/ in my Chrome webbrowser I get to see the phpinfo. The strange thing is, in my access log multiple entries are written for the index.php hit. For the favico (which does not exist) only one hit. See the log below.

130.233.178.70 - - [23/Sep/2010:05:00:27 +0000] "GET / HTTP/1.1" 200 10287 "-" "Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/534.3 (KHTML, like Gecko) Chrome/6.0.472.62 Safari/534.3"
130.233.178.70 - - [23/Sep/2010:05:00:27 +0000] "GET /index.php?=PHPE9568F34-D428-11d2-A769-00AA001ACF42 HTTP/1.1" 200 2536 "http://sub.example.com/" "Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/534.3 (KHTML, like Gecko) Chrome/6.0.472.62 Safari/534.3"
130.233.178.70 - - [23/Sep/2010:05:00:27 +0000] "GET /index.php?=SUHO8567F54-D428-14d2-A769-00DA302A5F18 HTTP/1.1" 200 2825 "http://sub.example.com/" "Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/534.3 (KHTML, like Gecko) Chrome/6.0.472.62 Safari/534.3"
130.233.178.70 - - [23/Sep/2010:05:00:27 +0000] "GET /index.php?=PHPE9568F35-D428-11d2-A769-00AA001ACF42 HTTP/1.1" 200 2158 "http://sub.example.com/" "Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/534.3 (KHTML, like Gecko) Chrome/6.0.472.62 Safari/534.3"
130.233.178.70 - - [23/Sep/2010:05:00:27 +0000] "GET /favicon.ico HTTP/1.1" 404 143 "-" "Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/534.3 (KHTML, like Gecko) Chrome/6.0.472.62 Safari/534.3"

What is causing this triple hit on index.php?

share|improve this question

2 Answers 2

up vote 1 down vote accepted

Just view source of generated page. You'll see that images have adresses like

<img border="0" src="/index.php?=PHPE9568F34-D428-11d2-A769-00AA001ACF42" alt="PHP Logo" />

That's because you have multiple requests in your log file

share|improve this answer

First of all you should upgrade Nginx to 0.7.67, as you can see form the Change Log 0.7.66 was a major update and staying at 0.7.65 is not recommended.

If you take a look at the actual requests you'll notice they are different as well.

?=PHPE9568F34
?=SUHO8567F54
?=PHPE9568F35

I can't tell you why they are different, but that is at least why Nginx is logging three requests. The odd thing is that the number after the status 200 is the number of bytes sent, so it's actually showing different content. Based on the requests this is at least partially related to suhosin according to the query string.

share|improve this answer
    
About upgrading, I prefer to stay with my operating system provided version. –  Peter Smit Sep 23 '10 at 5:51
    
There is a PPA available so that you can still use apt-get: launchpad.net/~nginx/+archive/stable –  Martin Fjordvald Sep 23 '10 at 7:03
    
How come Ubuntu did not offer a nginx update yet, through the standard update channels? –  ring0 Sep 23 '10 at 7:12
    
That PPA has no stable package (it failed building 5 weeks ago) –  Peter Smit Sep 25 '10 at 18:21
    
Passed that on Peter, it should have been fixed now. –  Martin Fjordvald Sep 26 '10 at 7:29

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.