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)
What does linux cd mean? In Linux, cd means chang...
In HTML, colors are represented in two ways. One i...
<br />Not long ago, due to business needs, I...
In the previous article, we have implemented loca...
Xiaobai learned about Vue, then learned about web...
Table of contents What is FormData? A practical e...
Web design is an emerging marginal industry that c...
Table of contents Preface How to switch between m...
1. Download 1. Download the installation package ...
1. Overview This article systematically explains ...
Table of contents Achieve results Introduction to...
This article example shares the specific code of ...
As a lightweight open source database, MySQL is w...
This article discusses several major zero-copy te...
symptom I set a crontab task on a centos7 host, b...