Posts

Showing posts with the label fastcgi

Nginx error says "upstream sent too big header while reading response header from upstream"

My PHP web server with Nginx as reverse proxy says "upstream sent too big header while reading response header from upstream" And, here is how to fix it: 1. Edit the nginx configuration for my site, for example, /etc/nginx/sites-available/mysite $ sudo nano /etc/nginx/sites-available/mysite Modify these lines ...         location ~ \.php$ {                 include snippets/fastcgi-php.conf;                 fastcgi_pass unix:/run/php/php7.0-fpm.sock;                 fastcgi_buffer_size 128k;                 fastcgi_buffers 4 256k;                 fastcgi_busy_buffers_size 256k;         } ... 2. Restart nginx and enjoy $ sudo systemctl restart nginx

Nginx access denied error

After setting up a new web root directory for my php app, all I see was: Access denied I removed this line in my server block and everything works: fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info; Because I set cgi.fix_pathinfo to 0 in /etc/php/7.0/fpm/php.ini so it conflicts with the above setting.