"The User Agent is required to access this page" message only goes away when I clear NGINX cache

I'm new to NGINX and can't really tell if there's a problem with it or with our app. My PHP application has a php package Device Detector that is responsible for User Agent info as well as CodeIgniter, which has a file UserAgent.php. I had an event where about 30 ppl tried accessing it. After they did the login, the message above showed up and only when we cleared NGINX cache the problem went away. We tried to replicate this error by switching GET to POST when testing the server but haven't been successful. We used loader.io to test server access and it runs fine (as do other apps on this server).Any ideas on how we could replicate it and what the problem is? Thanks


Most probably you have a badly coded application that blocks access when it is unable to detect "User-Agent" but returns the page with an error message with the normal HTTP 200 code instead of 403. As the return code doesn't indicate any errors then the error page gets cached and shown to all visitors until the cache is cleared.