当前位置:网站首页>Ningx 1.20.2
Ningx 1.20.2
2022-06-30 17:11:00 【Eternal wolf tooth】
1、 download
Stable version , Download the corresponding linux Version or windows edition . Download address
2、windows Installation in environment
- decompression : Directly decompress the downloaded compressed package , Cannot unzip in a folder containing a Chinese path , Otherwise it won't start .
- start-up : Direct double click nginx.exe Or on the command line nginx.exe You can start
- test : Browser access http://localhost:80, The following page appears, and the startup is successful .
- Common commands
nginx -s stop Fast closing Nginx, Information may not be saved , And quickly terminate web service .
nginx -s quit Close smoothly Nginx, Keep relevant information , There's an end to the arrangement web service .
nginx -s reload Because of the change Nginx Related configuration , Need to reload configuration and reload .
nginx -s reopen Reopen the log file .
nginx -c filename by Nginx Specify a profile , Instead of the default .
nginx -t Not running , Just test the configuration file .nginx The syntax of the configuration file will be checked for correctness , And try to open the file referenced in the configuration file .
nginx -v Show nginx Version of .
nginx -V Show nginx Version of , Compiler version and configuration parameters .
3、 Load balancing
upstream mysvr {
server 192.168.10.121:3333;
server 192.168.10.122:3333;
}
server {
....
location ~*^.+$ {
proxy_pass http://mysvr; # Request turn mysvr List of defined servers
}
}
- Hot standby : If you have 2 Servers , When a server crashes , To enable the second server to provide services .
upstream mysvr {
server 127.0.0.1:7878;
server 192.168.10.121:3333 backup; # Hot standby
}
- polling :nginx The default is that the polling weights are all defaulted to 1, The order in which the server processes requests :ABABABABAB…
upstream mysvr {
server 127.0.0.1:7878;
server 192.168.10.121:3333;
}
- Weighted polling : Different number of requests are distributed to different servers according to the configured weight . If not set , The default is 1. The request order of the following servers is :ABBABBABBABBABB…
upstream mysvr {
server 127.0.0.1:7878 weight=1;
server 192.168.10.121:3333 weight=2;
}
- ip_hash:nginx Will make the same client ip Request the same server .
upstream mysvr {
server 127.0.0.1:7878;
server 192.168.10.121:3333;
ip_hash;
}
About nginx Several state parameters of load balancing configuration :
- down, Represents the current server Do not participate in load balancing temporarily .
- backup, Reserved backup machine . When everything else is not backup When the machine breaks down or is busy , Only request backup machine , So this machine has the least pressure .
- max_fails, Number of requests allowed to fail , The default is 1. When the maximum number of times is exceeded , return proxy_next_upstream Module definition error .
- fail_timeout, After going through max_fails After failure , Time out of service .max_fails You can talk to fail_timeout Use it together .
upstream mysvr {
server 127.0.0.1:7878 weight=2 max_fails=2 fail_timeout=2;
server 192.168.10.121:3333 weight=1 max_fails=2 fail_timeout=1;
}
4、linux Installation and deployment under the system ( To be added ...)
边栏推荐
- 力士乐液控单向阀Z2S10-1-3X/
- Etcd教程 — 第九章 Etcd之实现分布式锁
- 平面相交与平面方程
- addmodule_allmerge_ams_im
- [wechat applet] the hosting environment of the applet
- redis淘汰策略
- The 25th anniversary of Hong Kong's return to China the Hong Kong Palace Museum officially opened as a new cultural landmark
- 声网自研传输层协议 AUT 的落地实践丨Dev for Dev 专栏
- [wechat applet] basic use of common components (view/scroll-view/wiper, text/rich-text, button/image)
- Data mining knowledge points sorting (final review version)
猜你喜欢
Raft introduction
Required plug-ins for idea
Deep learning - (2) several common loss functions
leetcode:787. K 站中转内最便宜的航班【k步最短路 + dfs记忆化 + defaultdict(dict)】
redis淘汰策略
ROC-RK3566-PC使用10.1寸IPS触摸屏显示
parker比例溢流阀RS10R35S4SN1JW
删除有序数组中的重复项 II[双指针--多情况统一]
【OpenCV 例程200篇】215. 基于多段线绘制近似椭圆
Property or method “approval1“ is not defined on the instance but referenced during render
随机推荐
基于SSM实现毕业设计管理系统
24: Chapter 3: develop pass service: 7: user defined exceptions (to represent errors in the program); Create graceexceptionhandler to handle exceptions globally and uniformly (build JSON data of corre
dart:字符串replace相关的方法
On July 2, I invited you to TD Hero online conference
Multi terminal collaboration of Huawei accounts to create a better internet life
编译丨迅为iTOP4412开发板Makefile编译
Differential analysis between different groups nichenet for silicosis runs successfully!
Dart: string replace related methods
Data mining knowledge points sorting (final review version)
ROC-RK3566-PC使用10.1寸IPS触摸屏显示
名单揭晓 | 2021年度中国杰出知识产权服务团队
Etcd tutorial - Chapter 9 etcd implementation of distributed locks
Etcd教程 — 第九章 Etcd之实现分布式锁
More dragon lizard self-developed features! Production available Anolis OS 8.6 officially released
restartProcessIfVisible的流程
Redis data structure analysis
Mathematical modeling for war preparation 35 time series prediction model
redis数据结构分析
华为帐号多端协同,打造美好互联生活
addmodule_allmerge_ams_im