部署使用docker容器,docker-compose.yml会将/data/nginx/目录挂进容器里的/etc/nginx目录里; 在系统上安装好docker后,执行如下步骤
mkdir /data
cd /data
git clone https://github.com/luo-zn/nginx.git
cd /data/nginx/
docker-compose up -d- nginx服务的整体配置位于nginx.conf
- nginx服务的http公共配置位于conf.d/features/http.conf
- nginx服务的stream公共配置位于conf.d/features/stream.conf
- nginx服务upstreams模块的配置位于conf.d/upstreams文件夹,根据nginx的特性模块分目录
- nginx服务server模块的配置位于conf.d/servers文件夹,根据nginx的特性模块分目录
- nginx服务server模块的location配置位于conf.d/locations文件夹,文件名根据服务命名
- conf.d/locations/static文件夹,存放静态文件的location
备注:新加的nginx配置应该按照模块和服务放置到对应的目录或者文件里,共用的配置应该放置在公共的地方