4

I have setup nginx in my server as a reverse proxy to haproxy. I have configured my own log_format and assigned it to every virtual host I have. However I have not turned off main access_log in nginx.conf.

The majority of my website logs 99.99% go to my custom access_log file, but some logs are making their way to main access_log file defined nowhere but in nginx.conf.

Why is this happening? What is so special about these request that do not get caught by our virtual hosts' access_log?

Thanks a lot

2
  • 1
    What is happening? What is your configuration? Commented Apr 3, 2013 at 20:42
  • "these requests" are most likely handled by a location block where access_log is not specifically set. This may happen due to internal rewrites (e.g. to internal locations) because logging is done at the very end of request processing (after rewriting, content serving etc.). Commented Apr 4, 2013 at 6:25

1 Answer 1

1

Most likely, it requests without Host: in HTTP header. So they don't "fall" into any virtualhost section of config.

1
  • access_log directives are declared in server sections so every location should use these directives. Also it seems that they are directed to virtual hosts by not specifying the http header. However, the virtual hosts listen to specific IPs, so these requests may point directly to the external IPs and not using DNS names, thus falling into the default virtual host of every IP. I will continue to investigate the issue and keep you updated. Thanks for your help! Commented Apr 27, 2013 at 12:23

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.