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

nginx简易配置

时间:2019-09-03 13:30:50      阅读:101      评论:0      收藏:0      [点我收藏+]

标签:org   ups   make   usr   status   figure   Fix   str   har   

下载安装

http://nginx.org/en/download.html

yum install -y pcre pcre-devel openssl openssl-devel
tar -xf nginx-1.14.0.tar.gz 
cd nginx-1.14.0/
./configure --prefix=/usr/local/nginx  --with-http_stub_status_module --with-http_ssl_module
make && make install 

配置

vim /usr/local/nginx/conf/nginx.conf

关键配置

http{

 upstream  web {
        server 127.0.0.1:50002;
        server 127.0.0.1:40002;
        server 127.0.0.1:30002;
        server 127.0.0.1:20002;

    }   

    server {
        listen       60002;
        server_name  127.0.0.1;

        #charset koi8-r;

        #access_log  logs/host.access.log  main;

        location / {
                proxy_pass http://web;
        }
}

运行

# 检查配置文件语法
/usr/local/nginx/sbin/nginx -t 
# 启动
/usr/local/nginx/sbin/nginx 
# 重启
/usr/local/nginx/sbin/nginx -s reload

nginx简易配置

标签:org   ups   make   usr   status   figure   Fix   str   har   

原文地址:https://www.cnblogs.com/cooolr/p/11452293.html

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