![](https://img-blog.csdnimg.cn/20201014180756923.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
nginx
nginx
小李白给了
这个作者很懒,什么都没留下…
展开
-
解决Linux下php-fpm进程过多导致内存耗尽问题
服务器的内存使用率较高# ps auxw|head -1;ps auxw|sort -rn -k4|head -40查看消耗内存最多的40个进程php-fpm服务池开启了太多子进程,占用超过大半内存。我们通过配置 pm.max_children 属性,控制php-fpm子进程数量# vi /etc/php/7.4/fpm/pool.d/www.confpm.max_children 字段,将数值改为50保存退出,重启php-fpm# systemctl restart php7.4-fp原创 2022-03-28 15:34:15 · 1995 阅读 · 0 评论 -
解决 nginx: [alert] kill(610, 1) failed (3: No such process) 问题
重启nginx报错nginx: [alert] kill(610, 1) failed (3: No such process)1. whereis nginx #定位nginx文件位置2. /usr/sbin/nginx -c /etc/nginx/nginx.conf #指定配置文件地址3. /etc/init.d/nginx reload #重新加载配置文件原创 2022-03-28 13:44:13 · 5293 阅读 · 0 评论 -
nginx rewrite跳转访问不同文件
使用rewrite跳转,将 test.wtyx.com/robots.txt 跳转到 test.wtyx.com/robots_disable.txt上location /robots.txt { rewrite (.+) http://test.wtyx.com/robots_disable.txt permanent; }第二种不用跳转重新定义test.wtyx.com/robots.txt的根目录location /robots.txt { root /srv/ww原创 2022-01-28 10:17:23 · 2466 阅读 · 0 评论 -
Nginx服务器中配置端口转发(反向代理)
部署Prometheus由于云主机只开放了80端口就用反向代理来做转发。使用Nginx的proxy_pass配置项。Nginx监听80端口,接收到请求之后就会转发到要转发的URL。配置如下server { listen 80 ; server_name 34.82.xx.xx ; location ~ / { proxy_pass http://127.0.0.1:9090; proxy_set_header Host $host:80; proxy_set_原创 2022-01-21 10:35:35 · 6688 阅读 · 0 评论 -
ubuntu检查nginx配置文件是否正确
服务器环境:ubuntu 20.04命令: sudo nginx -t -c /etc/nginx/conf.d如果看到这个提示则说明配置没有问题原创 2022-01-19 14:34:58 · 2348 阅读 · 0 评论 -
nginx使用include实现多域名访问
如果所有站点配置都放在nginx.conf文件中会非常杂乱。我们可以在nginx.conf文件中使用include一个文件夹的形式,这样只要给每个新增项目建一个 **.conf文件就好了。http { include vhosts_enable/* ;}server { listen 80; server_name abc.com www.abc.com; root /srv/www/seo/public/storage/sites/www.abc.com;原创 2022-01-05 13:57:55 · 1543 阅读 · 0 评论 -
配置Nginx上的静态网页在访问的时没有html后缀
不加html访问是404的写入nginx配置文件(nginx rewrite规则)location / { # //添加上以下代码: if (!-e $request_filename){ rewrite ^(.*)$ /$1.html last; break; }添加完重启nginx再次访问原创 2021-11-12 11:25:16 · 3692 阅读 · 0 评论 -
systemctl命令管理nginx
编译安装的nginx要使用/usr/local/nginx/sbin/nginx -s reload和/usr/local/nginx/sbin/nginx -s stop来重启和停止十分麻烦。现在我们来使用system来管理一、在/lib/systemd/system/创建文件[root@localhost ~]# vi /lib/systemd/system/nginx二、新建文件写入##配置参数解释##[Unit]Description=nginx原创 2021-10-19 22:56:51 · 917 阅读 · 0 评论 -
Nginx服务安全(一)
Nginx服务安全[root@node1 ~]# vim /usr/local/nginx/conf/nginx.confserver { ...... autoindex on;}[root@node1 ~]# /usr/local/nginx/sbin/nginx -s reload重命名网页目录下index.html,浏览器访问测试[root@node1 ~]# cd /usr/local/nginx/html/[root@node1 html]#原创 2021-07-13 22:50:16 · 100 阅读 · 0 评论 -
nginx设置用户认证
在server模块中添加:auth_basic "auth-domain:"; //认证提示符信息auth_basic_user_file "/usr/local/nginx/pass"; //认证的密码文件[root@web1 nginx-1.17.6]# yum -y install httpd-tools[root@web1 ~]# yum -y install httpd-tools[root@web1 nginx-原创 2021-06-22 16:09:59 · 693 阅读 · 0 评论 -
编译安装nginx
1 什么是nginxNginx是一款高性能的http 服务器/反向代理服务器及电子邮件(IMAP/POP3)代理服务器。由俄罗斯的程序设计师Igor Sysoev所开发,官方测试nginx能够支支撑5万并发链接,并且cpu、内存等资源消耗却非常低,运行非常稳定。2 应用场景1、http服务器。Nginx是一个http服务可以独立提供http服务。可以做网页静态服务器。2、虚拟主机。可以实现在一台服务器虚拟出多个网站。例如个人网站使用的虚拟主机。3、反向代理,负载均衡。当网站的访问量达到一定程度后,原创 2021-05-28 09:29:17 · 101 阅读 · 0 评论 -
nginx优化并发连接数
优化前使用ab高并发工具测试[root@web1 ~]# yum -y install httpd-tools[root@web1 ~]# rpm -qa httpd-toolshttpd-tools-2.4.6-97.el7.centos.x86_64[root@web1 ~]# ab -c 100 -n 100 http://192.168.2.100/ -c代表总人数,-n代表总访问量[root@web1 ~]# ab -c 2000 -n 2000 http://192.168.2.10原创 2021-06-01 16:17:58 · 595 阅读 · 0 评论