nginx常用命令及部署问题
来源:互联网 发布:淘宝t恤 编辑:程序博客网 时间:2024/06/10 02:22
1.pcre 版本太旧
rpm -aq|grep pcre 检查安装的pcre
rpm -e –nodeps pcre 卸载pcre 如果报错使用 rpm -e –nodeps –allmatches pcre
如果安装不上则下载低版本的nginx进行安装
2.为了避免重定向问题可以采用ip轮询的分配规则
具体配置文件参考
error_log logs/error.log debug; #制定日志路径,级别。这个设置可以放入全局块,http块,server块,级别以此为:debug|info|notice|warn|error|crit|alert|emergevents { accept_mutex on; #设置网路连接序列化,防止惊群现象发生,默认为on multi_accept on; #设置一个进程是否同时接受多个网络连接,默认为off #use epoll; #事件驱动模型,select|poll|kqueue|epoll|resig|/dev/poll|eventport worker_connections 1024; #最大连接数,默认为512}http { include mime.types; #文件扩展名与文件类型映射表 default_type application/octet-stream; #默认文件类型,默认为text/plain #access_log off; #取消服务日志 log_format myFormat '$remote_addr–$remote_user [$time_local] $request $status $body_bytes_sent $http_referer $http_user_agent $http_x_forwarded_for'; #自定义格式 access_log logs/access.log myFormat; #combined为日志格式的默认值 sendfile on; #允许sendfile方式传输文件,默认为off,可以在http块,server块,location块。 sendfile_max_chunk 100k; #每个进程每次调用传输数量不能大于设定的值,默认为0,即不设上限。 keepalive_timeout 65; #连接超时时间,默认为75s,可以在http,server,location块。 upstream mysvr { server 192.168.186.120:7002; server 192.168.186.123:7002; ip_hash; } error_page 404 https://www.baidu.com; #错误页 server { keepalive_requests 120; #单连接请求上限次数。 listen 4545; #监听端口 server_name 127.0.0.1; #监听地址 location / { proxy_pass http://mysvr; proxy_redirect off; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $http_host; proxy_set_header X-NginX-Proxy true; } }}
nginx命令
编译安装:
./configure –prefix=/opt/nginx –sbin-path=/usr/bin/nginx
make && make install
启动:
nginx
停止:
nginx -s stop
重启:
nginx -s reload
配置开机启动:
vim /etc/rc.d/rc.local
# 添加如下参数/usr/bin/nginx
chmod +x /etc/rc.d/rc.local
阅读全文
0 0
- nginx常用命令及部署问题
- cobbler常用命令及部署
- Linux常用命令及在关于Tomcat的部署问题
- Nginx在Ubuntu安装部署,常用命令
- docker 安装部署及常用命令
- nginx常用命令及简单配置
- Nginx 常用命令管理及升级
- nginx常用命令及简单配置
- nginx服务器安装及部署
- nginx服务器搭建及部署
- FastDFS及Nginx的部署
- nginx + keepalived 部署及配置
- Nginx优化及部署LNMP
- Nginx的配置与部署4)Nginx常用命令
- django+nginx+uwsgi 部署问题
- ubuntu下MYSQL安装部署及常用命令
- linux上部署项目及常用命令
- Nginx安装及配置以及常用命令
- 故障排除:无法启动、访问或连接到 Azure 虚拟机上运行的应用程序
- 浏览器内核
- Oracle 用户解锁
- Android数据存储之文件存储
- 【3】vim查找替换
- nginx常用命令及部署问题
- kernel panic 调试方法(1)
- PHP消息队列实现及应用:消息队列概念介绍
- Spark上的深度学习框架BigDL 介绍
- 最全前端开发资源汇集
- Leetcode刷题 Day6 217. Contains Duplicate
- 广州地铁五号线PSCADA系统介绍
- oracle数据库--SQL基础
- [UVA 107] The Cat int the Hat 数学公式和细节啊细节