码迷,mamicode.com
首页 > 其他好文 > 详细

nginx相关

时间:2018-06-06 12:31:14      阅读:114      评论:0      收藏:0      [点我收藏+]

标签:lib   安装nginx   pen   AC   backup   eve   conf   http   后退   

1.在Linux中安装nginx

(1)./configure --prefix=/usr/local/nginx
(2)yum -y install pcre-devel
(3)yum -y install zlib-devel
(4)yum install gcc

2.配置文件

请求:

location /waiweihunter {
  client_max_body_size 100m;
  proxy_connect_timeout 1200;
  proxy_send_timeout 1200;
  proxy_read_timeout 1200;
  root /home/ralf/waiweihunter189/webapps;
  proxy_pass http://127.0.0.1:8099;
  proxy_set_header Host $host;
  proxy_set_header X-Real-IP $remote_addr;
  proxy_set_header REMOTE-HOST $remote_addr;
  proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}

转发:

upstream neiwei_servers {
  server 127.0.0.1:8080;
  server 127.0.0.1:8091 backup;
}

3.启动:

nginx -c /usr/local/nginx/conf/nginx.conf

4.重启:

nginx -s reload(stop-直接退出、quit-当前请求处理后退出、reload-重新加载、reopen-重新打开日志文件)

 

nginx相关

标签:lib   安装nginx   pen   AC   backup   eve   conf   http   后退   

原文地址:https://www.cnblogs.com/smj1990/p/9144059.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!