![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
nginx
文章平均质量分 69
躁动的青年
招女朋友
展开
-
nginx配置stream模块做负载均衡
nginx配置stream模块做负载均衡原创 2023-02-23 18:22:40 · 692 阅读 · 0 评论 -
CentOS 安装nginx1.22
CentOS nginx安装配置原创 2023-02-23 13:44:44 · 826 阅读 · 0 评论 -
CentOS7 配置nginx开机自启动
vim /usr/lib/systemd/system/nginx.service[Unit]Description=nginxAfter=network.target [Service]Type=forkingExecStart=/opt/nginx/sbin/nginxExecReload=/opt/nginx/sbin/nginx -s reloadExecStop=/opt/nginx/sbin/nginx -s quitPrivateTmp=true [Install]原创 2021-06-28 15:10:49 · 565 阅读 · 0 评论 -
Nginx1.1.4+ 对后端机器的长连接特性
原文:http://zhangxugg-163-com.iteye.com/blog/1551269nginx upstream keepalive connectionsNginx从 1.1.4 开始,实现了对后端机器的长连接支持,这是一个激动人心的改进,这意味着 Nginx 与后端机器的通信效率更高,后端机器的负担更低。例如,对一个没有长连接支持的后端机...原创 2020-05-15 08:51:07 · 97 阅读 · 0 评论 -
nginx ip_hash获取真实源IP ngx_http_realip_module模块
原文:http://leo108.com/pid-2132.asprealip模块的作用是:当本机的nginx处于一个反向代理的后端时获取到真实的用户IP。如果没有realip模块,nginx的access_log里记录的IP会是反向代理服务器的IP,PHP中$_SERVER['REMOTE_ADDR']的值也是反向代理的IP而安装了realip模块,并且配置正确,就可...原创 2020-05-15 08:50:54 · 578 阅读 · 0 评论 -
nginx平滑升级添加模块
添加--with-http_realip_module不用停止服务,平滑升级,老的nginx进程处理完所有请求后退出,新的nginx进程处理新的请求备份nginxcp /opt/nginx/sbin/nginx /opt/nginx/sbin/nginx20160217cp /opt/nginx/conf/nginx.conf /opt/nginx/conf/ngi...原创 2020-05-15 08:50:50 · 123 阅读 · 0 评论 -
压力测试TCP参数优化TIME_WAIT
一、环境RHEL 6.5, Nginx 1.8.1RHEL 6.5,Websphere 7.0二、问题1.nginx报错connect() failed (110: Connection timed out) while connecting to upstream2.压力大时,nginx服务器和was服务器有大量TIME_WAIT连接,达到几万...原创 2020-05-15 08:45:45 · 186 阅读 · 0 评论 -
nginx性能优化配置长连接
http段 keepalive_timeout 65; #一个keepalive 连接被闲置以后还能保持多久打开状态。 keepalive_requests 1024; #一个keepalive 连接被闲置以后还能保持多久打开状态。(压力测试用,生产不用开启) upstream llacluster{ ip_hash; ser...原创 2020-05-15 08:45:42 · 208 阅读 · 0 评论 -
nginx日志打印响应时间request_time和upstream_response_time
设置log_format,添加request_time,$upstream_response_time,位置随意og_format main '"$request_time" "$upstream_response_time" $remote_addr - $remote_user [$time_local] "$request" ' ...原创 2020-05-15 08:45:37 · 743 阅读 · 0 评论 -
让Nginx的SSI支持相对路径
找到如下代码src/http/modules/ngx_http_ssi_filter_module.c找到以下代码if (ngx_http_parse_unsafe_uri(r, uri, &args, &flags) != NGX_OK) { return NGX_HTTP_SSI_ERROR; }将这段代码注释掉注释使用/* */然后重...原创 2020-05-15 08:11:50 · 79 阅读 · 0 评论 -
Nginx配置SSI
一.什么是SSIServer Side Include,通常称为服务器端嵌入,是一种类似于ASP的基于服务器的网页制作技术。大多数(尤其是基于Unix平台)的WEB服务器如Netscape Enterprise Server等均支持SSI命令。工作原理:将内容发送到浏览器之前,可以使用“服务器端包含 (SSI)”指令将文本、图形或应用程序信息包含到网页中。二.使用场景:...原创 2020-05-15 08:11:43 · 122 阅读 · 0 评论 -
nginx设置worker_processes,worker_connections,worker_rlimit_nofile
max_clients = worker_processes * worker_connectionsworker_processes number|autoworker_processes 4; //可以设置成auto,也可设置1到cpu个数或核数,不要超过cpu核数The auto parameter is supported starting from versions...原创 2020-05-15 08:49:21 · 450 阅读 · 0 评论 -
nginx配置404.html,50x.html
配置片段 error_page 404 /404.html; location = /404.html { root html; } # redirect server error pages to the static page /50x.html #...原创 2020-05-15 08:40:00 · 839 阅读 · 0 评论 -
nginx 反向代理超时upstream timed out 解决办法
报错:upstream timed out (110: Connection timed out) while reading response header from upstream设置代理超时:proxy_connect_timeout 65s; #连接超时 默认为60秒proxy_read_timeout 65s; #读取超时 默认为60秒proxy_send_t...原创 2020-05-15 08:39:57 · 2402 阅读 · 0 评论 -
nginx日志文件切割
创建脚本logcut.sh,放到/opt/nginx/sbin下在windows下编辑,可以把dos转unix格式#!/bin/bash## 零点执行该脚本## Nginx 日志文件所在的目录LOGS_PATH=/opt/nginx/logs## 获取昨天的 yyyy-MM-ddYESTERDAY=$(date -d "yesterday" +%Y-%m-%d...原创 2020-05-15 08:35:58 · 78 阅读 · 0 评论 -
nginx配置
最简单的配置在server中配置静态文件访问location可以配置多个,匹配最精确的,location /static { root /upload; index index.html index.htm; expires 30d; access_log off; }...原创 2020-05-15 07:29:53 · 90 阅读 · 0 评论 -
nginx上传模块下载安装
Nginx下载地址,英文文档http://happyqing.iteye.com/blog/1806478上传模块下载地址http://www.grid.net.ru/nginx/upload.en.htmlhttp://www.grid.net.ru/nginx/download/nginx_upload_module-2.2.0.tar.gzNginx-1....原创 2020-05-15 07:29:46 · 172 阅读 · 0 评论 -
nginx下载地址 在线文档
nginx下载地址http://nginx.org/en/download.htmlwindows版的左边是linux版的要下载Stable version版的,稳定版中文站点http://nginx.org/cn/文档http://nginx.org/cn/docs/linux下nginx安装,启动,停止http://happyqi...原创 2020-05-15 06:04:33 · 59 阅读 · 0 评论 -
linux下nginx安装,启动,停止,卸载,平滑升级,添加模块
nginx安装可以用root安装,也可以用其他用户sudo安装,还是用root安装简单需要先装gcc,我的已经安了,[oracle@dev Server]$ rpm -q gccgcc-4.1.2-51.el5pcre也安了,不是最新的[oracle@dev sbin]$ rpm -q pcrepcre-6.6-6.el5_6.1安装pcre (让nginx...原创 2020-05-15 06:04:25 · 231 阅读 · 0 评论