Giter VIP home page Giter VIP logo

nginx's Introduction

nginx

docker 快速部署 nginx 环境,适用于 HTML 页面站点,简单 Web 测试环境以及反向代理 docker 容器等需求.

部署

docker

在 root 目录下 git clone 本仓库用来挂载相关配置文件

cd ~
git clone https://github.com/stilleshan/nginx.git

启动 nginx 容器

docker run -d --name=nginx --restart=always \
    --network host \
    -v ~/nginx/conf/nginx.conf:/etc/nginx/nginx.conf \
    -v ~/nginx/vhost:/etc/nginx/conf.d/vhost \
    -v ~/nginx/ssl:/etc/nginx/ssl \
    -v ~/nginx/html:/usr/share/nginx/html \
    nginx

docker compose

cd ~
git clone https://github.com/stilleshan/nginx.git
cd nginx
docker-compose up -d

说明

~/nginx/conf 用于存放nginx 主配置文件

conf 目录下为官方 nginx.conf 配置文件,已新增 include vhost 目录以方便挂载多站点配置文件.

~/nginx/vhost 用于存放各站点 conf 配置文件

vhost 目录中已有常用的 conf 样本,参考修改域名和证书路径.

~/nginx/ssl 用于存放证书文件

ssl 目录有样本 conf 所需证书文件,如需删除请连同 conf 样本一起删除,避免 nginx 报错.

~/nginx/html 用于存放网页文件

html 目录为站点根目录,自行创建子目录存放网页以用来部署多个站点.

链接

Docker 打造支持快速部署和迁移的 Nginx 环境

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.