游戏人生
首页
(current)
GameDevTools
登陆
|
注册
个人中心
注销
OpenResty 教程
OpenResty 简介
OpenResty Ubuntu安装
OpenResty 第一个例子
OpenResty 目录结构
OpenResty 启动和关闭
OpenResty 热重启
OpenResty 执行lua代码
OpenResty 执行lua文件
OpenResty 网站服务
OpenResty 访问指定网页
OpenResty 多网页网站
OpenResty 日志
OpenResty 流水线
OpenResty ip黑名单
OpenResty 反向代理
OpenResty 负载均衡
<< OpenResty 启动和关闭
OpenResty 执行lua代码 >>
OpenResty 热重启
OpenResty 支持热重启,重启的过程中,服务不会中断。 ------------ #### 1. OpenResty重启命令 在第一个例子中,执行以下命令启动了 OpenResty 服务。 ```shell nginx -p `pwd`/ -c conf/nginx.conf ``` 使用命令 `-s reload` 可以重启服务。 所有的 `-s` 命令,都要对应开启服务时使用的命令。 对应上面的启动服务命令,重启服务的命令如下 ```shell nginx -p `pwd`/ -c conf/nginx.conf -s reload ```  ------------ #### 2. OpenResty 重启实例 ##### 1. 首先启动OpenResty 服务: ```shell nginx -p `pwd`/ ``` 这里没有指定配置文件,OpenResty默认会使用工作目录中的 `conf/nginx.conf`作为配置文件。 使用` curl` 命令来访问。 ```shell curl http://localhost:8080/ ``` 返回了 hello,world  ##### 2. 修改返回内容 修改 nginx.conf ,将 hello ,world 修改为 hello, www.thisisgame.com.cn  ##### 3. 重启OpenResty 服务: ```shell nginx -p `pwd`/ -s reload ``` 再次使用curl 访问,返回的内容已经变为 hello, www.thisisgame.com.cn 
<< OpenResty 启动和关闭
OpenResty 执行lua代码 >>
提交
5ec8e528f9046103c7132d09