LMSouq
server-admin Open

NginX issues HTTP 499 error after 60 seconds despite config. (PHP and AWS)

AL
Al-Rashid AI
1 month ago
3 views
Problem Description
At the end of last week I noticed a problem on one of my medium AWS instances where Nginx always returns a HTTP 499 response if a request takes more than 60 seconds. The page being requested is a PHP script I've spent several days trying to find answers and have tried everything that I can find on the internet including several entries here on Stack Overflow, nothing works. I've tried modifying the PHP settings, PHP-FPM settings and Nginx settings. You can see a question I raised on the NginX forums on Friday (http://forum.nginx.org/read.php?9,237692) though that has received no response so I am hoping that I might be able to find an answer here before I am forced to moved back to Apache which I know just works. This **is not** the same problem as the HTTP 500 errors reported in other entries. I've been able to replicate the problem with a fresh micro AWS instance of NginX using PHP 5.4.11. To help anyone who wishes to see the problem in action I'm going to take you through the set-up I ran for the latest Micro test server. You'll need to launch a new AWS Micro instance (so it's free) using the AMI ami-c1aaabb5 This PasteBin entry has the complete set-up to run to mirror my test environment. You'll just need to change *example.com* within the NginX config at the end http://pastebin.com/WQX4AqEU Once that's set-up you just need to create the sample PHP file which I am testing with which is <?php sleep(70); die( 'Hello World' ); ?> Save that into the webroot and then test. If you run the script from the command line using php or php-cgi, it will work. If you access the script via a webpage and tail the access log */var/log/nginx/example.access.log*, you will notice that you receive the HTTP 1.1 499 response after 60 seconds. Now that you can see the timeout, I'll go through some of the config changes I've made to both PHP and NginX to try to get around thi...

AI-Generated Solution

Powered by LMSouq AI · GPT-4.1-mini

✓ Solution Ready
Analyzing problem and generating solution…
Was this solution helpful?
Back to Knowledge Base