Plesk/nginx上传问题 [英] Plesk/nginx uploading issue

查看:108
本文介绍了Plesk/nginx上传问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

到目前为止,我已经在网上进行搜索并没有结果.所以我最后的努力是在这里问,希望这可以对此有所启发.

I have scoured the web and turned up no results so far. So my last effort is to ask here, hopefully this may shed some light on this.

我不能使最大上传大小超过2mb.

I cannot get the max upload size above 2mb.

我的猜测是plesk存在问题,尽管它会自动生成nginx配置,但似乎没有设置nginx配置的选项.对我来说,用SSH手动编辑它们毫无意义.

My guess is the issue is with plesk, it seems to have no options to set up the nginx configs even though it generates them automatically. Making it pointless for me to edit them manually in SSH.

PHP对每个虚拟主机都有以下设置:

PHP has these settings for every virtual host:

memory_limit 64M;

memory_limit 64M;

post_max_size 32M;

post_max_size 32M;

upload_max_filesize 16M;

upload_max_filesize 16M;

http块中的nginx具有此功能(我可以编辑该区域而无需重新更改):

nginx in the http block has this (the one area I can edit without plesk changing back):

client_max_body_size 64M;

client_max_body_size 64M;

client_body_buffer_size 128k;

client_body_buffer_size 128k;

plesk在每个nginx服务器块中自动生成此代码:

plesk generated this automatically in every nginx server block:

client_max_body_size 128m;

client_max_body_size 128m;

通常给出的错误是NGINX的413,使我相信php与之无关(但是服务器错误并不总是反映实际问题).

The error usually given is a 413 with NGINX, leading me to believe php in unrelated (but server errors do not always reflect the actual problem).

Nginx通过代理将连接路由到apache,但是我找不到针对apache的配置,只有"httpd",并且该配置也会自动生成.因为我看到的错误是由nginx产生的,所以我不敢相信apache是​​问题所在(但是如果有人有不同的想法,我会在这里指出)

Nginx routes the connection to apache through a proxy, however there is no configs that I can find for apache, just "httpd" and the config for that is automatically generated as well. Because the error I see is generated from nginx I am hesitant to believe apache is where the problem is (but I will note it here incase anyone has different thoughts)

到目前为止,我在命令行和plesk管理面板上都花了几个小时.两者绝对与2MB限制无关.我有一个猜测",就是我也需要将client_max_body_size添加到位置块,但是这意味着重新格式化服务器而没有plesk witch是不可行的.

I have spent a few hours so far in both command line and the plesk admin panel. Both so absolutely no relation to the 2MB limit. A "guess" i have is that I need to add the client_max_body_size to the location block as well, however that would mean reformatting the server without plesk witch is not an option.

因此,为了消除任何混乱,我要问的是,是否还有其他地方,nginx/apache/php可能会设置一个限制,而不是它们各自的配置文件,或者plesk是否可能为我设置了秘密的隐藏配置无法找到.

So to clear up any confusion what I am asking is if there is anywhere else that nginx/apache/php might setup a limit other then their respective configuration files, or if plesk may have a secret hidden config for them that I am unable to locate.

根据评论,这里有一些更多信息:

Based on comments here is some more info:

phpinfo文件显示所有设置均符合plesk设置.

The phpinfo file shows all settings as being proper as per plesk settings.

/etc/httpd/conf.d/中的php.conf文件没有LimitRequestBody.

the php.conf file in /etc/httpd/conf.d/ has no LimitRequestBody.

fcgid.conf文件的FcgidMaxRequestLen为1073741824

the fcgid.conf file's FcgidMaxRequestLen is 1073741824

推荐答案

我更改了/usr/local/psa/admin/conf/templates/default/nginxWebmailPartial.php
然后我执行了 plebin sbin httpdmng --reconfigure-all
最后,我执行了 service nginx restart ,一切正常.

我发现还可以,但是转到/usr/local/psa/admin/conf 我的Plesk版本存储了虚拟主机配置文件,并进行了递归grep grep -ir client_ *,并找到了唯一列出client_max_body_size 128m的文件;并将其更改为2048m,对我来说足够大了.

I changed /usr/local/psa/admin/conf/templates/default/nginxWebmailPartial.php
Then I performed plesk sbin httpdmng --reconfigure-all
Finally, I performed service nginx restart and everything worked.

I found that fine but going to /usr/local/psa/admin/conf which is where my version of Plesk stores vhost config files and did a recursive grep grep -ir client_ * and found the only file that listed the client_max_body_size 128m; and changed it to 2048m which was big enough for me.

这篇关于Plesk/nginx上传问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆