Home > Operation and Maintenance > Nginx > Why does nginx appear 404

Why does nginx appear 404

步履不停
Release: 2019-06-21 09:40:06
Original
21314 people have browsed it

Why does nginx appear 404

General reason: The requested Header is too large

Solution: Configure nginx.confRelated settings

client_header_buffer_size 16k;

large_client_header_buffers 4 64k;

Other common reasons:

413 Request Entity Too Large

General reasons: usually appear when uploading files

Solution: Configure nginx.conf related settings

client_max_body_size 10m;

Configure php.ini as follows (required Consistent with nginx.conf configuration)

post_max_size=10Mupload_max_filesize=2M

499 Client Closed Request

General reason: The client is waiting for the server to respond The client descriptor is closed before returning. It usually occurs when the client actively closes the socket after setting a timeout.

Solution: Modify the client timeout based on the actual processing time of the Nginx backend server.

500 Internal Server Rrror

General reasons: script error, (php syntax error, lua syntax error)

The number of visits is too large, system resources Restrictions, cannot open too many files

Insufficient disk space. (Enabling access log may cause disk overflow. Close it)

Solution: Check nginx_err_log php_err_log for syntax errors.

File visits:

1. Modify the nginx configuration file

worker_rlimit_nofile 65535;

2. Modify /etc/security/limits.conf

* soft nofile 65535* hard nofile 65535

502 Bad Gateway, 503 Serveice Unavailable

General reasons: The back-end service cannot be processed and the business is interrupted.

Solution: Obtain the error cause from the backend log and solve the backend server problem.

504 Gateway Timeout

General reason: The backend server did not respond to the Nginx proxy request within the timeout period

Solution: According to the backend server According to the actual processing situation, adjust the backend request timeout.

proxy_read_timeout 90;proxy_send_timeout 90;

General reason: The website page cache may be large, and the fastcgi default process response cache area is 8k

Solution: Configure nginx.conf related settings

fastcgi_buffers 8 128ksend_timeout 60;

For more Nginx related technical articles, please visit the Nginx Tutorial column Get studying!

The above is the detailed content of Why does nginx appear 404. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template