Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lumozx/toggle-nginx-conf
https://github.com/lumozx/toggle-nginx-conf
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/lumozx/toggle-nginx-conf
- Owner: lumozx
- Created: 2018-08-21T10:28:58.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-08-24T02:22:34.000Z (over 6 years ago)
- Last Synced: 2023-10-08T05:20:52.729Z (about 1 year ago)
- Language: JavaScript
- Size: 1.84 MB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Nginx配置切换工具
由于开发环境依赖dev1,因此就要监听80端口,但项目一多,nginx.conf的监听80端口变得臃肿且复杂
此项目由此而来#### 安装
```
npm install toggle-nginx-conf -g
```#### 在home目录下新建`/nginxConf/index.js`文件,模板如下:
```
module.exports = {
path: '/usr/local/etc/nginx/nginx.conf'
}
```
保存的nginx.conf地址#### nginx.conf规范
```
server {
#include servers/kong.conf;
#include servers/qywx.conf;
include servers/webapp.conf;
}
```
必须用include方式引入配置,且“#”与include之间无间隔。
每个include都是一个项目配置#### 运行命令
```
tnc
```执行成功后,会以选单的方式,显示所有include的路径。
通过checkbox的方式选择或组合conf