[乐意黎] Nginx 出现 "The connection was reset" 以及 "file not found" 等问题的解决方法

一、抛   The connection was reset 错误

get an error that says "The connection was reset" immediately when I upload a file over a certain size, I think it's over around 4MB.
My web server is running on nginx, I tried set client_max_body_size 1G or even setting to 0, no success.

I'd be glad to hear a solution.
Thanks!

Answer:

1. I just had to restart the nginx service by using "sudo service nginx restart" and it solved itself!

2.In my case, the file was bigger than the allowed size by NGINX in the setting "client_max_body_size". To change this setting open in your terminal the file /etc/nginx/nginx.conf and add the following inside the http section:

  nginx.conf里修改并添加 client_max_body_size 项

http {
  ...
  client_max_body_size 128m; #Any desired size in MB
  ...
}

In nginx versions from 1.0 and above, this setting is not included by default in the nginx.conf file.

二、 "file not found"的问题

问题原因:未在Localtion 中里定义网站根目录 root路径

解决:

1. 在 Server 定义了 root 路径



2. 修改location里的 fastcgi_param SCRIPT_FILENAME 的值

fastcgi_param SCRIPT_FILENAME scripts$fastcgi_script_name;

#解决办法:改成  

fastcgi_param SCRIPT_FILENAME /usr/wwwroot/site$fastcgi_script_name;
#其  /usr/wwwroot/site 为网站的根目录

3. location 项内容如下:

location ~ \.php$ {
  fastcgi_pass 127.0.0.1:9000;
  fastcgi_index index.php;
  fastcgi_param SCRIPT_FILENAME /usr/wwwroot/site$fastcgi_script_name;
  fastcgi_connect_timeout 300;
  fastcgi_send_timeout 300;
  fastcgi_buffer_size 64K;
  fastcgi_buffers 256 64k;
  include        fastcgi_params;
    # for 404
  fastcgi_intercept_errors on;
}

乐意黎

发布了430 篇原创文章 · 获赞 415 · 访问量 925万+
展开阅读全文

WSWS3713E异步IO操作失败,原因:RC:104来自IBM Websphere软件的对等错误连接重置

02-16

<div class="post-text" itemprop="text"> <p>I have been trying to solve this problem for quite some time but have been unsuccessful. We have two external service/data providers trying to send data to our website. One sends over SOAP web service we created and the other over PHP POST which we can capture using the PHP input stream. </p> <p>The SOAP web-service is written using PHP<br> The website and web service is over https using a wildcard SSL.<br> The server is a Windows server<br> When the first service/data provider try to push data to us by calling our SOAP web service they get the following error. </p> <pre><code>**************************************************************** WSWS3713E: Connection to the remote host mysubdomain.mydomain.com failed. Received the following error: Async IO operation failed, reason: RC: 104 Connection reset by peer **************************************************************** </code></pre> <p>This particular service provider uses IBM Websphere software. below is the header of their request... which they provided us </p> <pre><code>POST /clientswebservice/services/ClientsWS HTTP/1.1 Content-Type: text/xml; charset=utf-8 Accept: application/soap+xml, application/dime, multipart/related, text/* User-Agent: IBM WebServices/1.0 Host: otwebdev:9080 Cache-Control: no-cache Pragma: no-cache SOAPAction: "" Content-Length: 683 Proxy-Authorization: Basic Og== </code></pre> <p>We have another service provider pushing data to us, and their data is captured using PHP POST variable of the input stream. They get the following error, when they try to push data. </p> <pre><code> ************************************************************** java.net.SocketException: Connection reset when doing https://mywebsite.com/index.php/my_controller/my_function ************************************************************ </code></pre> <p>However we don't have confirmed information as to what software they use to post the data. <strong>Important note for the second provider:</strong> We were on a Linux server before, we moved to a Windows server recently due to some personal certificate requirement. The second service provider used to post the data just fine when we were on Linux with the wildcard SSL. </p> <p>But it works on a linux server over plain http!<br> To test both the service providers we put up a Linux server on Digitalocean. We set up the web services we have created on our main server (the windows server) here on the linux server. This server did not have a SSL cert installed. We then asked both the service/data providers to post data. And both of them were able to post data correctly and we were able to capture it. </p> <p>So we have a PHP application running on Windows server with SSL installed unable to accept data from the data provider, but the same application can capture the data from the data providers on a Linux server which does not have a SSL installed. And also the application used to work fine over SSL on Linux server. </p> <p>I have tried to describe as much as possible. Any help or pointer on what might be wrong and what areas I should dig into is highly appreciated. </p> <p>Thank you. </p> </div> 问答

没有更多推荐了,返回首页

©️2019 CSDN 皮肤主题: 编程工作室 设计师: CSDN官方博客

分享到微信朋友圈

×

扫一扫,手机浏览