Students who make websites often find that some nginx servers prompt 504 Gateway Time-out errors when accessing. Generally, this is caused by the slow response of the default fastcgi process of nginx, but there are other situations. Here I summarize some solutions for your reference. How to resolve the "504 Gateway Time-out" error Methods/StepsCase 1: The default fastcgi process response buffer of nginx is too smallThis situation causes the fastcgi process to be suspended. If the fastcgi service team does not handle this suspension well, it may prompt a "504 Gateway Time-out" error. Solution for situation 1: The default fastcgi process response buffer is 8K, we can set it larger, in This means setting the fastcgi buffer to 8 blocks of 128k in size. Solution to situation 1 (improvement):After modifying the above method, if the problem still occurs, we can continue to modify the nginx timeout parameter and increase the parameter a little, such as setting it to 60 seconds: After adjusting these two parameters, the "504 Gateway Time-out" error was no longer prompted, which shows that the effect is quite good and the problem is basically solved. Case 2: PHP environment configuration problemHere we need to modify the configuration of php-fpm and nginx. Because in this case, the "504 Gateway Time-out" error message will also appear. Solution for situation 2 (php-fpm configuration modification): Change Change Solution for situation 2 (modification of nginx configuration):In order to reduce the number of fastcgi requests and keep buffers unchanged, we need to change several nginx configuration items as follows: Change Change Change Change
The above is the editor’s introduction to solving the nginx "504 Gateway Time-out" error. I hope it will be helpful to everyone. I would also like to thank everyone for their support of the 123WORDPRESS.COM website! You may also be interested in:
|
<<: 7 interesting ways to achieve hidden elements in CSS
>>: Several ways to clear arrays in Vue (summary)
After learning the basic operations of Docker, we...
Problem Description In the login page of the proj...
Use auto.js to automate daily check-in Due to the...
<br />We usually declare DOCTYPE in HTML in ...
Use blockquote for long citations, q for short ci...
Scenario: A laradock development environment (php...
Install mysql5.7.21 in the window environment. Th...
I recently used the input size and maxlength attri...
download http://nginx.org/en/download.html Unzip ...
MySQL error: Parameter index out of range (1 >...
Table of contents front end According to the abov...
My recommendation Solution for coexistence of mul...
Vue parent component calls the function of the ch...
This tag is not part of HTML3.2 and is only suppo...
Copy code The code is as follows: a:link { font-s...