博客 / 詳情

返回

飛牛 Nas 部署 Docker Nginx

使用 Docker Compose 方式部署

在 /vol2/1000/docker-data/nginx/ 目錄下,創建 nginx.conf

worker_processes  1;
events {
    worker_connections  1024;
}
http {
    include       /etc/nginx/mime.types;
    server {
      listen       80;
      server_name  localhost;
      location / {
        root   /usr/share/nginx/html;
        index  index.html index.htm;
      }
    }
    access_log /var/log/nginx/access.log;
    error_log /var/log/nginx/error.log;
}
version: '3'
services:
  nginx:
    restart: always
    container_name: nginx
    image: nginx
    ports:
      - 5555:80
      - 443:443
    volumes:
      - /vol2/1000/docker-data/nginx/html:/usr/share/nginx/html
      - /vol2/1000/docker-data/nginx/www:/var/www
      - /vol2/1000/docker-data/nginx/logs:/var/log/nginx
      - /vol2/1000/docker-data/nginx/nginx.conf/:/etc/nginx/nginx.conf
      - /vol2/1000/docker-data/nginx/etc/cert:/etc/nginx/cert
      - /vol2/1000/docker-data/nginx/conf.d:/etc/nginx/conf.d
    environment:
      - NGINX_PORT=80
      - TZ=Asia/Shanghai
    privileged: true

執行以下命令,讓其有權限

chmod -R 777 /vol2/1000/docker-data/nginx/html/
user avatar
0 位用戶收藏了這個故事!

發佈 評論

Some HTML is okay.