<p> 1.路径: /etc/nginx/nginx.conf 和 /etc/nginx/conf.d,</p><p> 其实只有/etc/nginx/nginx.conf 这一个配置文件,因为在nginx.conf中,其他配置文件都是可以利用 include 指令·引入的</p><p> </p><p> 部分配置文件:</p><pre class="brush:bash;toolbar:false">server
{
listen80;
server_nametest.net;
root/var/www/test;
#includenone.conf;
#error_page404/404.html;
location~[^/]\.php(/|$)
{
includefastcgi_params;
fastcgi_pass127.0.0.1:9000;
fastcgi_indexindex.php;
client_max_body_size500m;
}
location~.*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires30d;
}
location~.*\.(js|css)?$
{
expires12h;
}
#location=/HBLS.deb{
#rewrite./HBLS.deb;
#default_typeapplication/x-deb;
#}
access_logoff;
#access_loglogs/lung.access.log;
#error_loglogs/lung.error.logdebug;
}</pre><p></p><p>2、设置文件上传大小限制</p><pre class="brush:bash;toolbar:false">location~[^/]\.php(/|$)
{
includefastcgi_params;
fastcgi_pass127.0.0.1:9000;
fastcgi_indexindex.php;
client_max_body_size500m;
}</pre><p>设置 client_max_body_size的大小即可,最好是在需要设置的配置文件中设置,灵活性</p>