Nginx Web服务应用

Nginx“engine x”)是一个开源的,支持高性能、高并发的WWW服务和代理服务软件。它还具有反向代理负载均衡功能和缓存服务功能。

 

1 Nginx的几个常见的重要特性

1、支持高并发:能支持几万并发连接(特别是静态小文件业务环境)

2、资源消耗少:在3万并发连接下,开启10Nginx线程消耗的内存不到200MB

3、可以做HTTP反向代理及加速缓存,即负载均衡功能,内置对RS节点服务器健康检查功能,这相当于专业的Haproxy软件或LVS的功能

4、具备Squid等专业缓存软件等的缓存功能

5、支持异步网络I/O事件模型epolllinux2.6+

2 Nginx软件的主要企业功能应用

1)作为web服务软件

支持高性能、高并发,与Apache相比,Nginx能够支持更多的并发连接访问,但占用的资源却更少,效率更高,几乎不逊色于Apache

2)反向代理或负载均衡服务

在方向代理或负载均衡服务方面,Nginx可以作为web服务、PHP等动态服务及Memcached缓存的代理服务器,它具有类似专业反向代理软件(如Haproxy)的功能,也是一个邮件代理服务软件,支持TCP的代理。

3)前端业务数据缓存服务

web缓存服务方面,Nginx可以通过自身的proxy_cache模块实现类Squid等专业缓存软件的功能

3 Nginx Web服务

3.1 Nginx Web服务介绍

作为web服务器的主要应用场景:

1)使用Nginx运行HTMLJSCSS、小图片等静态数据(类似Lighttpd

2Nginx结合FastCGI运行PHP等动态程序(使用fastcgi_pass方式)

3Nginx结合Tomcat/Resin等支持Java动态程序(常用proxy_pass方式)

3.2 为什么Nginx总体性能比Apache

Nginx使用epollkqueuefreebsd)异步网络I/O模型,而Apache使用的是传统的select模型。目前Linux下能够承受高并发访问的SquidMemcached软件采用的都是epoll模型

处理大量连接的读写时,select网络I/O模型比较低效。而epoll却很高效

宿管比喻:

Select:带着你到各个房间挨个去找人,知道找到人为止。

Epoll:会先记下每个人住的房间号,当你找人时,只需要告诉你住哪个房间即可,不用亲自带着你满宿舍楼找人了。

如果同时来了100个人找人,效率差别就很明显了。

3.3 如何正确选择web服务器

静态业务:若是高并发场景,尽量采用NginxLighttpd,二者首选Ngingx

动态业务:理论上采用NginxApache均可,建议选择Nginx,为了避免相同业务的服务软件多样化,增加维护成本。动态业务可以由Nginx兼做前端代理,再转发到后端相应的服务器进行处理。

既有静态业务又有动态业务:采用Nginx

如果并发不是很大,又对Apache熟悉,也可以选择Apache,总之选择熟悉的。

4 编译安装Nginx

4.1 检查系统版本

[root@lnmp02 ~]# cat /etc/redhat-release
CentOS release 6.5 (Final)
[root@lnmp02 ~]# uname -r
2.6.32-431.el6.x86_64
[root@lnmp02 ~]# uname -m
x86_64

4.2 安装Nginx所需的 pcre pcre-devel

[root@lnmp02 ~]# rpm -qa pcre pcre-devel
pcre-7.8-6.el6.x86_64
[root@lnmp02 ~]# yum install pcre pcre-devel -y
[root@lnmp02 ~]# rpm -qa pcre pcre-devel
pcre-7.8-7.el6.x86_64
pcre-devel-7.8-7.el6.x86_64

4.3 安装 openssl-devel openssl

[root@lnmp02 ~]# rpm -qa openssl-devel openssl
openssl-1.0.1e-15.el6.x86_64
[root@lnmp02 ~]# yum install openssl-devel -y
[root@lnmp02 ~]# rpm -qa openssl-devel openssl
openssl-1.0.1e-57.el6.x86_64
openssl-devel-1.0.1e-57.el6.x86_64

4.4 安装 Ngnix

下载Nginx软件

[root@lnmp02 ~]# rpm -qa ngnix
[root@lnmp02 tools]#  wget -q http://nginx.org/download/nginx-1.6.3.tar.gz
[root@lnmp02 tools]# ls -l
总用量 788
-rw-r--r-- 1 root root 805253 4月   8 2015 nginx-1.6.3.tar.gz

 

解压Nginx

[root@lnmp02 tools]# tar xf nginx-1.6.3.tar.gz  
[root@lnmp02 tools]# cd nginx-1.6.3
[root@lnmp02 nginx-1.6.3]# ls
auto  CHANGES  CHANGES.ru  conf  configure  contrib  html  LICENSE  man  README  src
[root@lnmp02 nginx-1.6.3]# tree|wc -l
404

创建nginx用户 设置安装具体细节

[root@lnmp02 nginx-1.6.3]# useradd nginx -s /sbin/nologin -M
[root@lnmp02 nginx-1.6.3]# ./configure --user=nginx --group=nginx --prefix=/application/nginx-1.6.3/ --with-http_stub_status_module --with-http_ssl_module
[root@lnmp02 nginx-1.6.3]# make
[root@lnmp02 nginx-1.6.3]# make install
[root@lnmp02 nginx-1.6.3]# echo $?
0

创建软链接

[root@lnmp02 nginx-1.6.3]# cd ..
[root@lnmp02 tools]# ln -s /application/nginx-1.6.3/ /application/nginx
[root@lnmp02 tools]# ls -l /application/
总用量 4
lrwxrwxrwx 1 root root   25 6月  24 16:58 nginx -> /application/nginx-1.6.3/
drwxr-xr-x 6 root root 4096 6月  24 16:57 nginx-1.6.3

安装搞定,启动并检查安装结果

启动前检查语法
[root@lnmp02 tools]# /application/nginx/sbin/nginx -t
nginx: the configuration file /application/nginx-1.6.3//conf/nginx.conf syntax is ok
nginx: configuration file /application/nginx-1.6.3//conf/nginx.conf test is successful
启动服务
[root@lnmp02 tools]# /application/nginx/sbin/nginx
查看nginx服务是否启动成功
[root@lnmp02 tools]# ps -ef|grep nginx|grep -v grep
root       7125      1  0 17:05 ?        00:00:00 nginx: master process /application/nginx/sbin/nginx
nginx      7126   7125  0 17:05 ?        00:00:00 nginx: worker process       
[root@lnmp02 tools]# ss -lntup|grep nginx
tcp    LISTEN     0      128                    *:80                    *:*      users:(("nginx",7125,6),("nginx",7126,6))
[root@lnmp02 tools]# netstat -lntup|grep nginx
tcp        0      0 0.0.0.0:80                  0.0.0.0:*                   LISTEN      7125/nginx        
用curl命令检测是否成功
[root@lnmp02 tools]# curl 127.0.0.1
<!DOCTYPE html>
<html>
<head>
<title>Welcome to nginx!</title>  《=============看到此处欢迎说明成功了,也可以用浏览器输出服务器地址来检测,也可以用wget命令测试
<style>
    body {
        width: 35em;
        margin: 0 auto;
        font-family: Tahoma, Verdana, Arial, sans-serif;
    }
</style>
</head>
<body>
<h1>Welcome to nginx!</h1>
<p>If you see this page, the nginx web server is successfully installed and
working. Further configuration is required.</p>
 
<p>For online documentation and support please refer to
<a href="http://nginx.org/">nginx.org</a>.<br/>
Commercial support is available at
<a href="http://nginx.com/">nginx.com</a>.</p>
 
<p><em>Thank you for using nginx.</em></p>
</body>
</html>

5 Nginx深入剖析

5.1 Nginx http功能模块汇总

http_core_module      

包括一些核心的http参数配置

http_access_module    

访问控制模块

http_gzip_module      

压缩模块

http_fastcgi_module   

fastcgi模块

http_proxy_module    

代理模块

http_upstream_module 

负载均衡模块

http_rewrite_module    

URL地址重写模块

http_limit_conn_module 

限制用户的并发连接以及请求数

http_limit_req_module 

定义的key限制nginx请求过程的速率

http_log_module     

访问日志模块,指定格式记录nginx客户访问日志

http_auth_basic_module 

web认证,设置web用户通过账号和密码访问nginx

http_ssl_module       

加密的http

http_stub_status_module

记录nginx基本访问状态信息

 

5.2 Nginx的目录结构

图片.png

图片.png

5.3 主配置文件nginx.conf

     1
     2  #user  nobody;
     3  worker_processes  1;
     4
     5  #error_log  logs/error.log;
     6  #error_log  logs/error.log  notice;
     7  #error_log  logs/error.log  info;
     8
     9  #pid        logs/nginx.pid;      #1~9为Main区,核心功能模块
    10
    11
    12  events {                   
    13      worker_connections  1024;   #12~13行为events区,核心功能模块
    14  }
    15
    16
    17  http {                         #17行是http区开始,http核心模块
    18      include       mime.types;
    19      default_type  application/octet-stream;
    20
    21      #log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
    22      #                  '$status $body_bytes_sent "$http_referer" '
    23      #                  '"$http_user_agent" "$http_x_forwarded_for"';
    24
    25      #access_log  logs/access.log  main;
    26
    27      sendfile        on;
    28      #tcp_nopush     on;
    29
    30      #keepalive_timeout  0;
    31      keepalive_timeout  65;
    32
    33      #gzip  on;
    34
    35      server {                   #35~46为server区块
    36          listen       80;
    37          server_name  localhost;
    38
    39          #charset koi8-r;
    40
    41          #access_log  logs/host.access.log  main;
    42
    43          location / {               #location区块
    44              root   html;
    45              index  index.html index.htm;
       46          }
       47      }
       48  }               #http区块结束


整个Nginx配置文件的核心框架如下:

worker_processes  1;
events {
    worker_connections  1024;
}
http {
    include       mime.types;
    server {
        listen       80;
        server_name  localhost;
        location / {
            root   html;
            index  index.html index.htm;
        }      
    }
}

关于配置文件的详细解释

[root@lnmp02 ~]# egrep -v "#|^$" /application/nginx/conf/nginx.conf.default
worker_processes  1;            <===worker进程数量
events {                       <===事件区块开始
    worker_connections  1024;   <===每个worker进程支持的最大连接数
}                             <===事件区块结束
http {                         <===http区块开始
    include       mime.types;       <===Nginx支持的媒体类型库文件
    default_type  application/octet-stream;    <===默认的媒体类型
    sendfile        on;                   <===开启高效传输模式
    keepalive_timeout  65;                 <===连接超时
    server {                    <===第一个server区块开始,表示一个虚拟主机站点
        listen       80;         <===提供服务的端口,默认80
        server_name  localhost;   <===提供服务的域名主机名
        location / {              <===第一个location区块开始
            root   html;         <===站点的根目录,相当于Nginx的安装目录
            index  index.html index.htm;  <===默认首页文件,多个用空格分开
        }                             <===第一个location区块结束
        error_page   500 502 503 504  /50x.html;  <===出现对应的状态码时,使用50x.html回应客户
        location = /50x.html {             <===location区块开始,访问50x.html
            root   html;                <===指定对应的站点目录为html
        }
    }
}                                      <===http区块结束


6 Nginx虚拟主机配置

6.1 Nginx虚拟主机配置(以基于域名的虚拟主机为例)

1、基于域名的虚拟主机*****

2、基于端口的虚拟主机***

3、基于IP的虚拟主机

增加新域名对应的配置

[

root@lnmp02 tools]# cd /application/nginx
[root@lnmp02 nginx]# cd conf/
[root@lnmp02 conf]# egrep -v "#|^$" nginx.conf.default  >nginx.conf
[root@lnmp02 conf]# vim nginx.conf
worker_processes  1;
events {
    worker_connections  1024;
}
http {
    include       mime.types;
    default_type  application/octet-stream;
    sendfile        on;
    keepalive_timeout  65;
    server {
        listen       80;    《=============若配置基于端口或者IP的虚拟主机,在此修改端口号或者添加IP
        server_name  www.etiantian123.org;
        location / {
            root   html/www;
            index  index.html index.htm;
        }
    }
     server {
        listen       80;    《=============例如:基于IP:192.168.4.122:80
        server_name  bbs.etiantian123.org;
        location / {
            root   html/bbs;
            index  index.html index.htm;
        }
    }
 
}

检查语法

[root@lnmp02 conf]# /application/nginx/sbin/nginx -t
nginx: the configuration file /application/nginx-1.6.3//conf/nginx.conf syntax is ok
nginx: configuration file /application/nginx-1.6.3//conf/nginx.conf test is successful

创建域名对应的站点目录及文件

[root@lnmp02 conf]# mkdir ../html/{www,bbs}
[root@lnmp02 conf]# tree ../html/
../html/
├── 50x.html
├── bbs
├── index.html
└── www
[root@lnmp02 conf]# echo "www.etiantian.org" >../html/www/index.html
[root@lnmp02 conf]# echo "bbs.etiantian.org" >../html/bbs/index.html
[root@lnmp02 conf]# cat  ../html/{www,bbs}/index.html
www.etiantian.org
bbs.etiantian.org

平滑启动服务

[root@lnmp02 conf]# /application/nginx/sbin/nginx -s reload

修改/etc/hosts

[root@lnmp02 conf]# vim /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.4.122 lnmp02
192.168.4.122 www.etiantian123.org
192.168.4.122 bbs.etiantian123.org

curl测试是否成功

[root@lnmp02 conf]# curl www.etiantian123.org
www.etiantian.org
[root@lnmp02 conf]# curl bbs.etiantian123.org
bbs.etiantian.org
如果是windows测试,则需要修改/etc/hosts文件,格式和linux一致


规范优化Nginx配置文件

[root@lnmp02 conf]# cat nginx.conf
worker_processes  1;
events {
    worker_connections  1024;
}
http {
    include       mime.types;
    default_type  application/octet-stream;
    sendfile        on;
    keepalive_timeout  65;
    #nginx vhosts config
    include extra/www.conf;
    include extra/bbs.conf;
    include extra/blog.conf;
}
[root@lnmp02 conf]# mkdir extra
[root@lnmp02 conf]# sed -n '10,17p' nginx.conf.ori.1
    server {
        listen       80;
        server_name  www.etiantian123.org;
        location / {
            root   html/www;
            index  index.html index.htm;
        }      
    }  
[root@lnmp02 conf]# sed -n '10,17p' nginx.conf.ori.1 >extra/www.conf
[root@lnmp02 conf]# cat extra/www.conf
    server {
        listen       80;
        server_name  www.etiantian123.org;
        location / {
            root   html/www;
            index  index.html index.htm;
        }      
    }  
[root@lnmp02 conf]# sed -n '18,25p' nginx.conf.ori.1 >extra/bbs.conf   
[root@lnmp02 conf]# sed -n '26,33p' nginx.conf.ori.1
     server {
        listen       80;
        server_name  blog.etiantian123.org;
        location / {
            root   html/blog;
            index  index.html index.htm;
        }
    }
[root@lnmp02 conf]# sed -n '26,33p' nginx.conf.ori.1 >extra/blog.conf

配置好检查一下

[root@lnmp02 conf]# cat extra/blog.conf
[root@lnmp02 conf]# cat extra/bbs.conf 
[root@lnmp02 conf]# cat extra/www.conf

重启下服务

[root@lnmp02 conf]# ../sbin/nginx -t
nginx: the configuration file /application/nginx-1.6.3//conf/nginx.conf syntax is ok
nginx: configuration file /application/nginx-1.6.3//conf/nginx.conf test is successful
[root@lnmp02 conf]# ../sbin/nginx -s reload

6.2 Nginx虚拟主机的别名配置

[root@lnmp02 conf]# cat extra/www.conf
    server {
        listen       80;
        server_name  www.etiantian123.org etiantian123.org; <===直接在域名后面添加别名
        location / {
            root   html/www;
            index  index.html index.htm;
        }      
    }

/etc/hosts添加别名的解析

[root@lnmp02 conf]# cat /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.4.122 lnmp02
192.168.4.122 www.etiantian123.org etiantian123.org    <=======添加别名
192.168.4.122 bbs.etiantian123.org
192.168.4.122 blog.etiantian123.org
192.168.4.122 status.etiantian123.org

检查并重新加载服务

[root@lnmp02 conf]# ../sbin/nginx -t
[root@lnmp02 conf]# ../sbin/nginx -s reload

6.3 Nginx状态信息功能

[root@lnmp02 conf]# cat extra/status.conf
##status    
    server {
        listen       80;
        server_name  status.etiantian123.org;
        location / {
            stub_status on;        <============打开状态信息开关
            access_log   off;
        }      
    }

 

增加包含文件的配置到主配置文件

[root@lnmp02 conf]# cat nginx.conf
worker_processes  1;
events {
    worker_connections  1024;
}
http {
    include       mime.types;
    default_type  application/octet-stream;
    sendfile        on;
    keepalive_timeout  65;
    #nginx vhosts config
    include extra/www.conf;
    include extra/bbs.conf;
    include extra/blog.conf;
    include extra/status.conf;   <============增加status配置


检查语法重启服务

[root@lnmp02 conf]# ../sbin/nginx -t
[root@lnmp02 conf]# ../sbin/nginx -s reload

6.4 Nginx增加错误日志配置

[root@lnmp02 conf]# cat nginx.conf
worker_processes  1;
error_log  logs/error.log;    #<=======默认配置这一行即可
events {
    worker_connections  1024;
}
http {
    include       mime.types;
    default_type  application/octet-stream;
    sendfile        on;
    keepalive_timeout  65;
    #nginx vhosts config
    include extra/www.conf;
    include extra/bbs.conf;
    include extra/blog.conf;
    include extra/status.conf;
}

6.5 Nginx访问日志

访问日志的配置

[root@lnmp02 conf]# vim nginx.conf
worker_processes  1;
error_log  logs/error.log;
events {
    worker_connections  1024;
}
http {
    include       mime.types;
    default_type  application/octet-stream;
    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '  #
                      '$status $body_bytes_sent "$http_referer" '           #
                      '"$http_user_agent" "$http_x_forwarded_for"';        #增加这三行
    sendfile        on;
    keepalive_timeout  65;
    #nginx vhosts config
    include extra/www.conf;
    include extra/bbs.conf;
    include extra/blog.conf;
    include extra/status.conf;
}

然后在每个虚拟主机里进行配置(以www为例子)

[root@lnmp02 conf]# vim extra/www.conf
    server {
        listen       80;
        server_name  www.etiantian123.org etiantian123.org;
        location / {
            root   html/www;
            index  index.html index.htm;
        }
        access_log logs/access_www.log main;     《=====增加一行日志配置,main是为日志格式指定的标签
    }

检查并重启服务

[root@lnmp02 conf]# ../sbin/nginx -t
nginx: the configuration file /application/nginx-1.6.3//conf/nginx.conf syntax is ok
nginx: configuration file /application/nginx-1.6.3//conf/nginx.conf test is successful
[root@lnmp02 conf]# ../sbin/nginx -s reload

用浏览器模拟用户访问生成日志,在服务器上查询结果

[root@lnmp02 conf]# tail -1 ../logs/access_www.log
192.168.4.101 - - [25/Jun/2017:00:54:50 +0800] "GET /favicon.ico HTTP/1.1" 404 570 "-" "Mozilla/4.0 (compatible; MSIE 7.0; LBBROWSER)" "-"

在高并发场景下提升网站访问性能,可以加上bufferflush选项参数,打包

access_log logs/access_www.log main gzip buffer=32K flush=5s

Ngnix访问日志轮询切割

创建脚本

[root@lnmp02 conf]# vim /server/scripts/cut_nginx_log.sh
#!/bin/sh
Dateformat=`date +%Y%m%d`
Basedir="/application/nginx"
Nginxlogdir="$Basedir/logs"
Logname="access_www"
[ -d $Nginxlogdir ] && cd $Nginxlogdir||exit 1
[ -f ${Logname}.log ]||exit 1
/bin/mv ${Logname}.log ${Dateformat}_${Logname}.log
#/bin/mv access_bbs.log ${Dateformat}_access_bbs.log
#/bin/mv access_blog.log ${Dateformat}_access_blog.log
$Basedir/sbin/nginx -s reload

通过定时任务实现每天0点执行/server/scripts/cut_nginx_log.sh来切割日志

[root@lnmp02 conf]# crontab -e
#########nginx访问日志切割################
00 00 * * * /bin/sh /server/scripts/cut_nginx_log.sh &>/dev/null

测试效果

[root@lnmp02 logs]# /bin/sh /server/scripts/cut_nginx_log.sh
[root@lnmp02 logs]# ll
总用量 100
-rw-r--r-- 1 root root  1458 6月  25 00:54 20170625_access_www.log
-rw-r--r-- 1 root root 40537 6月  25 00:54 access.log
-rw-r--r-- 1 root root     0 6月  25 01:13 access_www.log
-rw-r--r-- 1 root root 44005 6月  25 01:13 error.log
-rw-r--r-- 1 root root     5 6月  24 17:05 nginx.pid

7 Nginx rewrite

指令语法:rewrite regex replacement [flag]

rewrite ^/ (.*)  http://www.etiantian.org/$1 permanent;

 

flag标记说明

flag标记符号

说明

last

本条规则匹配完成后,继续向下匹配新的location URI规则

break

本条规则匹配完成后即终止,不再匹配后面的任何规则

redirect

返回302临时重定向,浏览器显示跳转后的URL地址

permanent

返回301永久重定向,浏览器显示跳转后的URL地址

 

7.1 301跳转

 

[root@lnmp02 conf]# vim extra/www.conf
    server {
        listen       80;
        server_name  etiantian123.org;
              rewrite ^/ (.*)  http://www.etiantian123.org/$1 permanent;
               #当用户访问etiantian123.org及下面的任意内容时,都会通过这条rewrite跳转到www.etiantian123.org对应的地址
}
 
    server {
        listen       80;
        server_name  www.etiantian123.org;
        location / {
            root   html/www;
            index  index.html index.htm;
        }
        access_log logs/access_www.log main;
}

7.2 不同域名的URL跳转

实现访问http://blog.etiantian123.org时跳转到

http://www.etiantian123.org/blog/wangxin.html

 

跳转前,http://blog.etiantian123.org对应的站点配置如下:

[root@lnmp02 conf]# vim extra/blog.conf
server {
        listen       80;
        server_name  blog.etiantian123.org;
        location / {
            root   html/blog;
            index  index.html index.htm;
        }
        if  ( $http_host ~* “^(.*)\.etiantian123\.org$” ) {
               set $domain $1;
               rewrite ^(.*)  http://www.etiantian123.org/$domain/wangxin.html break;
               }
}

要配置的规则内容为:

if  ( $http_host ~* “^(.*)\.etiantian123\.org$” ) {
               set $domain $1;
               rewrite ^(.*)  http://www.etiantian123.org/$domain/wangxin.html break;
               }

跳转后,http://www.etiantian123.org/blog/wangxin.html地址对应的站点配置如下

[root@lnmp02 conf]# vim extra/www.conf
    server {
        listen       80;
        server_name  www.etiantian123.org;
        location / {
            root   html/www;
            index  index.html index.htm;
        }
        access_log logs/access_www.log main;
}

8 Nginx 访问认证

虚拟主机的配置

[root@lnmp02 nginx]# vim conf/extra/www.conf
    server {
        listen       80;
        server_name  www.etiantian123.org etiantian123.org;
        location / {
            root   html/www;
            index  index.html index.htm;
            auth_basic            "wangxin test";
            auth_basic_user_file  /application/nginx/conf/htpasswd;
        }
        access_log logs/access_www.log main;
    }

设置帐号密码,并修改权限

[root@lnmp02 nginx]# yum install -y httpd
[root@lnmp02 nginx]# which htpasswd
/usr/bin/htpasswd
 
[root@lnmp02 nginx]# htpasswd -bc /application/nginx/conf/htpasswd wangxian 123456
Adding password for user wangxian
[root@lnmp02 nginx]# chmod 400 /application/nginx/conf/htpasswd
[root@lnmp02 nginx]# chown nginx /application/nginx/conf/htpasswd
[root@lnmp02 nginx]# cat /application/nginx/conf/htpasswd
wangxian:K4zAKSh.uY.sY     ç===密码是加密的


检查语法,重启服务

[root@lnmp02 nginx]# /application/nginx/sbin/nginx -t
nginx: the configuration file /application/nginx-1.6.3//conf/nginx.conf syntax is ok
nginx: configuration file /application/nginx-1.6.3//conf/nginx.conf test is successful
[root@lnmp02 nginx]# /application/nginx/sbin/nginx -s reload

浏览器测试



發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章