Currently Viewing Posts Tagged directives

Change directives of Nginx

My new server uses Nginx as a web server. When I check the error log of it, I saw a lot of warnings.

2016/08/27 07:30:03 [warn] 11951#11951: *590544 an upstream response is buffered to a temporary file /var/cache/nginx/fastcgi_temp/3/28/0000008283 while reading upstream, client:, server:, request: “GET /download/file.php?id=109 HTTP/1.1”, upstream: “fastcgi://unix:/run/php/php7.0-fpm.sock:”, host: “”

I did the search and found some posts about this kind of warnings. OK, let record it and see what happened later.

Increase buffers.

Edit /etc/nginx/nginx.conf

fastcgi_buffers 32 8k;

Continue reading “Change directives of Nginx”

How to enable GBK encoding

The situation is WebPage was made by GBK encoding. GBK is one of the Chinese Encoding.
When the browser loading the page, it always return UTF-8.
It should be GBK.
I checked the head of the webpage.

content=”text/html; charset=gb2312″

Different browsers tested. All failed.
How to fix this problem and let the server feedback the GBK/GB2312 code?

Continue reading “How to enable GBK encoding”

Upload file with socket enabled

I have a website, which allow user to upload large file. Such as 200MB flv file through WEB interface. This kind of upload is not use FTP, not the regular php upload function, or get, post form function. The large file has to use socket to upload.
It need socket enabled on PHP.
I do have the –enable-sockets configuration on PHP.

The problem is happened when I upload the big file, it is always stopped or died on certain parts. About 4MB size.
I think it must be time out of php script.
Later I found a directive called
The default value is 60. It means 60 seconds.

Continue reading “Upload file with socket enabled”

Why .htaccess does not work

Last Friday, I put an .htaccess file into one folder of my site. The function of this htaccess is to make it auto redirect to other path.
The problem is it is not working. I do have use this kind of code many times. Why it does not work any more?
It looks the Apache works like there is no this .htaccess file here. I think it must be something wrong in my httpd.conf setting.
After double checking with Apache tutorial, I found the answer.

Continue reading “Why .htaccess does not work”

Explicitly using Options to permit CGI execution

When I setup my VPS with MovableType installation. I do not want to install it into cgi-bin. I would like to install it under folder name mt5 or mt5cgi.
But it is not executive folder for CGI files. How can I do it?
I checked the Apache site and got answer.

Options +ExecCGI

Add following Directives into the host section.
Options +ExecCGI
It can make any cgi files in any folders inside of this domain execution.

  • Archives