IT Knowledge Base

Technical Repository

HowTo: Nginx/PHP, Fix the “Upstream sent too big header while reading” error

tail -f /usr/local/nginx/logs/error.log [error] 17142#0: *4 upstream sent too big header while reading response header from upstream Add this to your http {} of the nginx.conf file normally located at /etc/nginx/nginx.conf: proxy_buffer_size 128k; proxy_buffers 4256k; proxy_busy_buffers_size 256k; Then add this to your php location block, this will be located in your vhost file look for the block that begins with location […]

Read More


HowTo: Update Nginx Configuration to support PHP files

These are the default settings for Nginx. Open /usr/local/nginx/conf/nginx.conf to edit. nano /usr/local/nginx/conf/nginx.conf location ~ \.php$ { root html; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name; include fastcgi_params; } Update the nginx.conf file to these settings location ~ \.php$ { root /var/www; fastcgi_pass unix:/var/run/php5-fpm.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } In order to use […]

Read More


HowTo: Fix “unix:/var/run/php5-fpm.sock failed (13: Permission denied)”

If you look at the /usr/local/nginx/logs/error.log and see the following error, you can use the next steps to resolve the problem. connect() to unix:/var/run/php5-fpm.sock failed (13: Permission denied) while connecting to upstream, client: xx.xxx.xx.xx Change the owner of php5-fpm.sock and set permission to 660. chown nginx:nginx /var/run/php5-fpm.sock chmod 660 /var/run/php5-fpm.sock Open the php5-fpm configuration file […]

Read More


HowTo: Enable the Status page for NGINX

Nginx has status page to give you information about Nginx’s server health including Active connections and other data. These statistics applied to the entire Nginx server and not per virtual host. nginx -V | grep –color -o http_stub_status Open Nginx.conf file to enable the status page. nano /usr/local/nginx/conf/nginx.conf Update the server { } block with […]

Read More