Record nginx two solutions

Source: Internet
Author: User
Tags php syntax error connection reset
Record nginx two problems Solution 1: recv error [php] recv () failed (104: Connectionresetbypeer) whilereadingclientrequestline this problem occurs mainly because of network problems, during aizher.com server migration ,... record nginx two problems Solution 1: recv error [php] recv () failed (104: Connection reset by peer) while reading client request line this problem occurs mainly because of network problems, during the migration of the aizher.com server, we encountered such a problem, which was a special problem. it was also a network problem, but it was not a problem to describe the local network port conflict on the Internet. The reason for this problem is that you need to configure a whitelist on the western Data Server to access the server. Previously, I only performed DNS resolution on the Western data server. for the first time, the client can go to the server, however, Western data will immediately reset the request connection, causing nginx to prompt the connection recharge error. The solution is also very simple. simply add a whitelist to the server where the Western data is located. (I did not know about the white list for a long time at first, but I forgot it.) 2: js. The image is executed by php. Another problem encountered during the migration of the aizher.com server was that js, css, and images were executed by php (of course this was known later). at the beginning, the whole server page is spent, and the page style is messy. In addition, some images can be loaded normally, while others cannot. png and jpg images cannot be loaded. At that time, due to the php configuration problem, I found N for a long time and did not find the cause. Later, [php] error_reporting = E_ALL &~ E_NOTICE opened the php notice prompt and found that when a png image was requested, a php syntax error was reported, which suddenly occurred to nginx configuration problems and all requests, all are parsed by php. The original nginx configuration is [php] server_name * .aizher.com; index index.html index.htm index. php; root/home/admin/web/; location \ $ {fastcgi_pass 127.0.0.1: 9000; fastcgi_index index. php; include fastcgi_params; fastcgi_param SCRIPT_FILENAME/home/admin/web/$ fastcgi_script_name;} after finding the cause, adjust the following [php] server_name * .aizher.com; index inde X.html index.htm index. php; root/home/admin/web/; if (! -E $ request_filename) {rewrite ^ (. *) $/index. php? S = $1 last;} location ~. * \. (Php | php5 )? $ {Fastcgi_pass 127.0.0.1: 9000; fastcgi_index index. php; include fastcgi_params; fastcgi_param SCRIPT_FILENAME/home/admin/web/$ fastcgi_script_name;} location/status {stub_status on; access_log off;} location ~. * \. (Gif | jpg | jpeg | png | bmp | swf) $ {expires 30d;} location ~. * \. (Js | css )? $ {Expires 12 h;} you may ask why you didn't copy the previous nginx and use it directly. The reason is: 1: There are other services on this server. nginx files cannot be directly overwritten. Previously, lnmp was used. this server was built from scratch, and fpm was not used, so .... 2: I think it is easy to solve this problem because I am too small to look at it.

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.