I usually deploy Java webapps in Tomcat servers and access them through an Apache proxy, using proxy_ajp. The thing is, in my latests setups (which are all basically the same) I see that the status code I get in all my requests is duplicated (i.e., "Status Code:200 200"). I get this in every browser, in Postman, and for any status code I might get, and everything seems to work fine, but I'm concerned my setup might not be optimal.
Although I can't find a solution, I have narrowed the issue down to the ajp_proxy, as if I change
ProxyPass / ajp://localhost:8009/
ProxyPassReverse / ajp://localhost:8009/
with:
ProxyPass / http://localhost:8080/
ProxyPassReverse / http://localhost:8080/
I get just a single status code for my requets, as expected.
I have searched for this issue and I haven't found anything even marginally related to it, so any information would be very much appreciated.
Server information:
Thanks in advance.
Tomcat 8.5 removed the "HTTP status reason phrase" from the response, so you'll get HTTP 200
instead of HTTP 200 OK
in the response. It's possible that your observations are from software that duplicates the status code into the status reason phrase for display.
How are you observing the status code? You may find that if you do a protocol trace, you'll see that there is only a single status code being sent by Tomcat / httpd.