I have been using apache for a long time, and I heard that nginx has excellent performance, so I decided to use nginx instead of apache in the project, and nginx can be installed without any installation requirements.
However, I found some problems when using nginx. First, files cannot be uploaded if they exceed a certain size. After checking the data in the background, I found that there is a default file size for uploading, and the nginx parameters need to be adjusted.
Later, I discovered that an operation that took a long time to execute was thrown without waiting for the result to be returned. I immediately thought it was a timeout problem and checked nginx.conf.
have inside:
#keepalive_timeout 0;
keepalive_timeout 65;
Changing to keepalive_timeout 300; (5 minutes) does not work,
Later it was changed to the following:
#keepalive_timeout 0;
#keepalive_timeout 65;
keepalive_timeout 300;
send_timeout 300;
proxy_read_timeout 300;
The above has introduced the timeout problem of Ngnix, including aspects of it. I hope it will be helpful to friends who are interested in PHP tutorials.