I use Nginx_apache as webserver because in my opinion this is a useful for serving static content through Nginx at high speed while Apache takes care of dynamic content like PHP (like the documentation says).
I was looking into some performance issues for my server and I was curious how I could check if Nginx was actually used for serving static content. The locations for the logfiles of both webservers are easily found. So I did a request on the clients websites and checked the access log for Nginx and Apache. To my surprise both logfiles showed the same simple request to a jpg file. The only thing different is the size of the response.
/var/log/nginx/domains/mydomain.nl.log
A HTTP 200 response with size 10941. This matches the size of the requested file.
/var/log/httpd/domains/mydomain.nl.log
A HTTP 200 response with size 661. What is this? And why is this request even made? Isn't Nginx supposed to keep this request away from Apache to reduce load?
[edit] I see I overlooked something. The requests do not only differ in size but also in protocol. Nginx receives a HTTP/2.0 request and Apache receives an HTTP/1.0 request. This could be just Nginx passing his own request as an HTTP/1.0 request but I still wanted to point it out.
I was looking into some performance issues for my server and I was curious how I could check if Nginx was actually used for serving static content. The locations for the logfiles of both webservers are easily found. So I did a request on the clients websites and checked the access log for Nginx and Apache. To my surprise both logfiles showed the same simple request to a jpg file. The only thing different is the size of the response.
/var/log/nginx/domains/mydomain.nl.log
Code:
x.x.x.x - - [11/Feb/2022:15:49:45 +0100] "GET /wp-content/uploads/2019/10/20190930-testfile-601-270x394.jpg HTTP/2.0" 200 10941 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.99 Safari/537.36"
/var/log/httpd/domains/mydomain.nl.log
Code:
x.x.x.x - - [11/Feb/2022:15:49:45 +0100] "GET /wp-content/uploads/2019/10/20190930-testfile-601-270x394.jpg HTTP/1.0" 200 661 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.99 Safari/537.36"
[edit] I see I overlooked something. The requests do not only differ in size but also in protocol. Nginx receives a HTTP/2.0 request and Apache receives an HTTP/1.0 request. This could be just Nginx passing his own request as an HTTP/1.0 request but I still wanted to point it out.
Last edited: