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)
During the work development process, a requiremen...
Table of contents Components - Timeline Custom no...
The detailed process of using MySQL database with...
The mysql 5.7.18 zip version of MySQL is not like...
Step 1: Enter the directory: cd /etc/mysql, view ...
Background Recently, when writing SQL statements,...
The order in which objects call methods: If the m...
Conversion between rgba and filter values under...
Problem Description When we are working on a proj...
Take the deployment of https://gitee.com/tengge1/...
When we preview PDF on the page, some files canno...
Preface Tip: Here you can add the approximate con...
This article shares with you the graphic tutorial...
Table of contents 1. Teleport 1.1 Introduction to...
Table of contents Preface text 1. Closure 1.1 Wha...