使Nginx支持超长地址栏

试验前准备如果配置文件打不开,删除交换文件
交换文件产生(缓存文件)
修改文件时,不保存 强制退出vim、强制断开终端会产生交换文件

1、还原配置文件
启服务
cd /usr/local/nginx/
[root@proxy nginx]# cp conf/nginx.conf.default conf/nginx.conf
cp:是否覆盖"conf/nginx.conf"? y
[root@proxy nginx]# sbin/nginx

[root@proxy nginx]# sbin/nginx -s reload
2、访问测试,查看端口
 netstat -ntulp | grep nginx
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      1690/nginx: master
[root@proxy nginx]# curl 192.168.2.5
<!DOCTYPE html>
<html>
<head>
<title>Welcome to nginx!</title>

让Nginx支持超长地址
 cd -
/usr/local/nginx 
vim conf/nginx.conf
client_header_buffer_size 200k;   #用户访问地址栏长度支持200k大小
large_client_header_buffers 4 200;   #如果不够再给4个200k
[root@proxy nginx]# sbin/nginx -s reload
[root@proxy nginx]# cd -
/root/lnmp_soft
[root@proxy lnmp_soft]# ./buffer.sh 访问测试,看不到414报错,则成功
<!DOCTYPE html>
<html>
<head>
<title>Welcome to nginx!</title>

网站压力测试工具

 [root@web1 ~]# ab -c 200 -n 200 http://192.168.2.5/

ulimit -Hn 100000     同时被打开,硬限制
[root@proxy nginx]# ulimit -Sn 100000  同时被打开, 软限制
[root@proxy nginx]# ulimit  -n 查询系统打开文件数量
永久配置
vim /etc/security/limits.conf
G到最后53、54
*         soft       nofile (文件访问量)     100000
*         hard      nofile                              100000
修改完重启服务器
 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值