Lỗi NginxLỗi
504 Gateway Timeout504 Gateway Timeout — Nginx hết thời gian chờ cổng kết nối
Nginx hết thời gian chờ phản hồi từ máy chủ upstream.
nginxserver
Nguyên nhân gây ra lỗi này
Máy chủ upstream không phản hồi trong khoảng proxy_read_timeout (mặc định 60s). Backend có thể đang quá tải hoặc bị treo.
Cách sửa
Tăng proxy_read_timeout. Tối ưu thời gian phản hồi upstream. Thêm caching cho các endpoint chậm. Kiểm tra tình trạng backend.
Ví dụ
# Increase proxy timeout
proxy_connect_timeout 300;
proxy_send_timeout 300;
proxy_read_timeout 300;Mã lỗi liên quan
Lỗi NginxLỗi
403 Forbidden403 Forbidden — Nginx Từ Chối Truy Cập
Nginx đã từ chối quyền truy cập vào tài nguyên được yêu cầu.
nginxserver
Xem chi tiết Lỗi NginxLỗi
could not build server_names_hashcould not build server_names_hash — Lỗi bảng băm tên máy chủ
Nginx không thể xây dựng bảng hash tên server.
nginxserver
Xem chi tiết Lỗi NginxLỗi
recv() failed (104: Connection reset by peer)recv() failed (104: Connection reset by peer) — Kết Nối Bị Reset
Client reset kết nối trong quá trình truyền dữ liệu.
nginxserver
Xem chi tiết Lỗi NginxLỗi
client body temp file write errorclient body temp file write error — Ghi tệp tạm thất bại
Nginx không thể ghi phần thân yêu cầu của client vào file tạm.
nginxserver
Xem chi tiết Lỗi NginxLỗi
connect() failed (111: Connection refused)connect() failed (111: Connection refused) — Upstream Từ Chối Kết Nối
Nginx không thể kết nối đến máy chủ upstream.
nginxserver
Xem chi tiết Lỗi NginxLỗi
400 Bad Request400 Bad Request — Nginx Yêu Cầu Không Hợp Lệ
Nginx từ chối yêu cầu client do yêu cầu HTTP không đúng định dạng.
nginxserver
Xem chi tiết