Nginx Errors:upstream Response Cache Error

Source: Internet
Author: User


Nginx Errorsupstream Response Cache Error

*2470578 an upstream response are buffered to a temporary file/var/cache/nginx/proxy_temp/6/10/0000010106 while reading up Stream


To fix



 
vim /etc/nginx/nginx.conf
# in http part of nginx.conf
proxy_buffer_size 512k;
proxy_buffers 8 512k;
proxy_busy_buffers_size 512k;
proxy_temp_file_write_size 512k;





Client request Body Cache error

*2445185 a client request body is buffered to a temporary file/var/cache/nginx/client_temp/0000010019


To fix



 
## in http part of nginx.conf
client_max_body_size  5M;
client_body_buffer_size  1M;


Client send too large body size error (nginx 413)

*1245147 client intended to send too large body:15152741 bytes


To fix



 
## in server location part 
client_max_body_size  30M;


PHP fastcgi Cache Error

*2502029 an upstream response are buffered to a temporary file/var/cache/nginx/fastcgi_temp/3/11/0000010113 while reading Upstream


To fix



 
fastcgi_buffer_size 128k;
fastcgi_buffers 8 128k;
fastcgi_busy_buffers_size 128k;
fastcgi_temp_file_write_size 128k;


PHP fastcgi path_info Error

*1280448 using uninitialized "path_info" variable


To fix


## refer to https://www.nginx.com/resources/wiki/start/topics/examples/phpfcgi/#
 
## fastcgi_param
## vim /etc/nginx/fastcgi_param
    fastcgi_param   QUERY_STRING            $query_string;
    fastcgi_param   REQUEST_METHOD          $request_method;
    fastcgi_param   CONTENT_TYPE            $content_type;
    fastcgi_param   CONTENT_LENGTH          $content_length;
    
    fastcgi_param   SCRIPT_FILENAME         $document_root$fastcgi_script_name;
    fastcgi_param   SCRIPT_NAME             $fastcgi_script_name;
    fastcgi_param   PATH_INFO               $fastcgi_path_info;
    fastcgi_param       PATH_TRANSLATED         $document_root$fastcgi_path_info;
    fastcgi_param   REQUEST_URI             $request_uri;
    fastcgi_param   DOCUMENT_URI            $document_uri;
    fastcgi_param   DOCUMENT_ROOT           $document_root;
    fastcgi_param   SERVER_PROTOCOL         $server_protocol;
    
    fastcgi_param   GATEWAY_INTERFACE       CGI/1.1;
    fastcgi_param   SERVER_SOFTWARE         nginx/$nginx_version;
    
    fastcgi_param   REMOTE_ADDR             $remote_addr;
    fastcgi_param   REMOTE_PORT             $remote_port;
    fastcgi_param   SERVER_ADDR             $server_addr;
    fastcgi_param   SERVER_PORT             $server_port;
    fastcgi_param   SERVER_NAME             $server_name;
    
    fastcgi_param   HTTPS                   $https;
    
    # PHP only, required if PHP was built with --enable-force-cgi-redirect
    fastcgi_param   REDIRECT_STATUS         200;

## vim /etc/nginx/conf.d/server1.conf
    location ~ [^/]\.php(/|$) {
        fastcgi_split_path_info ^(.+?\.php)(/.*)$;
        if (!-f $document_root$fastcgi_script_name) {
            return 404;
        }
    
        fastcgi_pass 127.0.0.1:9000;
        fastcgi_index index.php;
        include fastcgi_params;
    }





[Emerg] Could not build the server_names_hash ...

Start using Nginx only a virtual host, the default server_name will use LocalHost, today configured Nginx server_name is a formally existing domain name, the error is as follows:


 
[email protected]/0 $ nginx -t
nginx: [emerg] could not build the server_names_hash, you should increase server_names_hash_bucket_size: 32
nginx: configuration file /etc/nginx/nginx.conf test failed


How to fix


Add the following configuration to the HTTP segment of the Nginx configuration file nginx.conf:



 
# vi /etc/nginx/nginx.conf
...
http {
        ...
        server_names_hash_max_size 512;
        server_names_hash_bucket_size 128;
        ...
}
...

[email protected]/0 $ nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful



Nginx Officialserver_nameInstructions please refer to the link



Instance configuration:



Cat/etc/nginx/nginx.conf



Client_max_body_size 100M;
Client_body_buffer_size 128k;



Proxy_buffers 8 512k;
Proxy_buffer_size 512k;
Proxy_busy_buffers_size 512k;
Proxy_temp_file_write_size 512k;






Nginx Errors:upstream Response Cache Error


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.