首页 > 系统相关 >docker-compose 安装nginx

docker-compose 安装nginx

时间:2024-04-07 13:57:57浏览次数:25  
标签:compose application text image nginx vnd video docker

docker-compose.yaml

version: '3.3'
services:
  nginx:
    image: nginx
    restart: always
    hostname: nginx
    container_name: nginx
    privileged: true
    ports:
      - 80:80
      - 443:443
    volumes:
      - ./nginx/conf/:/etc/nginx/                   # 配置文件
      - ./nginx/cert/:/etc/cert/                    # ssl证书
      - ./nginx/www/:/usr/share/nginx/html/         # 默认显示的index网页
      - ./nginx/logs/:/var/log/nginx/               # 日志文件

文件目录

mime.types


types {
    text/html                                        html htm shtml;
    text/css                                         css;
    text/xml                                         xml;
    image/gif                                        gif;
    image/jpeg                                       jpeg jpg;
    application/javascript                           js;
    application/atom+xml                             atom;
    application/rss+xml                              rss;

    text/mathml                                      mml;
    text/plain                                       txt;
    text/vnd.sun.j2me.app-descriptor                 jad;
    text/vnd.wap.wml                                 wml;
    text/x-component                                 htc;

    image/avif                                       avif;
    image/png                                        png;
    image/svg+xml                                    svg svgz;
    image/tiff                                       tif tiff;
    image/vnd.wap.wbmp                               wbmp;
    image/webp                                       webp;
    image/x-icon                                     ico;
    image/x-jng                                      jng;
    image/x-ms-bmp                                   bmp;

    font/woff                                        woff;
    font/woff2                                       woff2;

    application/java-archive                         jar war ear;
    application/json                                 json;
    application/mac-binhex40                         hqx;
    application/msword                               doc;
    application/pdf                                  pdf;
    application/postscript                           ps eps ai;
    application/rtf                                  rtf;
    application/vnd.apple.mpegurl                    m3u8;
    application/vnd.google-earth.kml+xml             kml;
    application/vnd.google-earth.kmz                 kmz;
    application/vnd.ms-excel                         xls;
    application/vnd.ms-fontobject                    eot;
    application/vnd.ms-powerpoint                    ppt;
    application/vnd.oasis.opendocument.graphics      odg;
    application/vnd.oasis.opendocument.presentation  odp;
    application/vnd.oasis.opendocument.spreadsheet   ods;
    application/vnd.oasis.opendocument.text          odt;
    application/vnd.openxmlformats-officedocument.presentationml.presentation
                                                     pptx;
    application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
                                                     xlsx;
    application/vnd.openxmlformats-officedocument.wordprocessingml.document
                                                     docx;
    application/vnd.wap.wmlc                         wmlc;
    application/wasm                                 wasm;
    application/x-7z-compressed                      7z;
    application/x-cocoa                              cco;
    application/x-java-archive-diff                  jardiff;
    application/x-java-jnlp-file                     jnlp;
    application/x-makeself                           run;
    application/x-perl                               pl pm;
    application/x-pilot                              prc pdb;
    application/x-rar-compressed                     rar;
    application/x-redhat-package-manager             rpm;
    application/x-sea                                sea;
    application/x-shockwave-flash                    swf;
    application/x-stuffit                            sit;
    application/x-tcl                                tcl tk;
    application/x-x509-ca-cert                       der pem crt;
    application/x-xpinstall                          xpi;
    application/xhtml+xml                            xhtml;
    application/xspf+xml                             xspf;
    application/zip                                  zip;

    application/octet-stream                         bin exe dll;
    application/octet-stream                         deb;
    application/octet-stream                         dmg;
    application/octet-stream                         iso img;
    application/octet-stream                         msi msp msm;

    audio/midi                                       mid midi kar;
    audio/mpeg                                       mp3;
    audio/ogg                                        ogg;
    audio/x-m4a                                      m4a;
    audio/x-realaudio                                ra;

    video/3gpp                                       3gpp 3gp;
    video/mp2t                                       ts;
    video/mp4                                        mp4;
    video/mpeg                                       mpeg mpg;
    video/quicktime                                  mov;
    video/webm                                       webm;
    video/x-flv                                      flv;
    video/x-m4v                                      m4v;
    video/x-mng                                      mng;
    video/x-ms-asf                                   asx asf;
    video/x-ms-wmv                                   wmv;
    video/x-msvideo                                  avi;
}

nginx.conf


user  nginx;
worker_processes  auto;

error_log  /var/log/nginx/error.log notice;
pid        /var/run/nginx.pid;


events {
    worker_connections  1024;
}


http {
    include       /etc/nginx/mime.types;
    default_type  application/octet-stream;

    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';

    access_log  /var/log/nginx/access.log  main;

    sendfile        on;
    #tcp_nopush     on;

    keepalive_timeout  65;

    #gzip  on;

    include /etc/nginx/conf.d/*.conf;
}

标签:compose,application,text,image,nginx,vnd,video,docker
From: https://www.cnblogs.com/JQL-blog/p/18118884

相关文章

  • 基于新版宝塔Docker部署在线客服系统过程小记
    我在业余时间开发维护了一款免费开源的升讯威在线客服系统,也收获了许多用户。对我来说,只要能获得用户的认可,就是我最大的动力。客服系统开发过程中,最让我意外的是对TCP/IP协议的认识。过去一直认为TCP/IP是可靠的连接,加上过去开发的软件网络环境比较稳定,很少在这个问题上纠结......
  • Docker容器中修改mysql最大连接数(永久)
    程序连接mysql报错:Toomanyconnections,解决方法是修改mysql里的连接数。showvariableslike"%conn%";    查看 max_connections最大连接数,max_user_connections单用户最大连接数。进入docker内部的bash命令可执行界面:dockerps   查看mysql镜像......
  • java中大型医院HIS系统源码 Angular+Nginx+SpringBoot云HIS运维平台源码
    java中大型医院HIS系统源码Angular+Nginx+SpringBoot云HIS运维平台源码云HIS系统是一款满足基层医院各类业务需要的健康云产品。该产品能帮助基层医院完成日常各类业务,提供病患预约挂号支持、病患问诊、电子病历、开药发药、会员管理、统计查询、医生工作站和护士工作站等一......
  • docker清理空间
    查看磁盘占用情况df-lh查看当前目录占用情况du-sh*查看docker占用情况dockersystemdfTYPE 列出了docker使用磁盘的4种类型:Images:所有镜像占用的空间,包括拉取下来的镜像,和本地构建的。Containers:运行的容器占用的空间,表示每个容器的读写层的空间。LocalV......
  • Docker基本学习(运维)
     一、背景介绍1.什么是dockerDocker,翻译过来就是码头工人Docker是一个开源的应用容器引擎,让开发者可以打包他们的应用以及依赖包到一个可抑制的容器中,然后发布到任何流行的Linux机器上,也可以实现虚拟化。容器完全使用沙盒机制,相互之间不会存在任何接口。几乎没有性能开销,可......
  • Docker in Docker原理与实战
    DockerinDocker原理与实战Docker是一种广泛使用的容器化技术,它允许开发者将应用程序及其依赖项打包到一个可移植的容器中,并在各种环境中一致地运行。但是,在某些情况下,我们可能需要在Docker容器内部再次运行Docker容器,这就是所谓的DockerinDocker(简称DinD)。本文将深入探......
  • ubuntu 20.04 安装 docker-compose
    1.安装Docker在Ubuntu20.04安装Docker先启用Docker存储库,导入存储库GPG密钥,然后安装Docker。1.1安装sudoaptinstallapt-transport-httpsca-certificatescurlgnupg-agentsoftware-properties-common-ysudoapt-getremovedockerdocker.iocontainerdrunc-y......
  • docker-运行nacos服务
    环境说明linux系统版本:lsb_release-a  docker版本:docker-v  不同的操作系统以及软件版本,可能会遇到不一样的问题,一定要注意版本问题。 最好是确认自己的服务器已经设置阿里云的镜像加速,或者使用腾讯的,网易的都是可以的。自己选,设置之后下载镜像的速度回快......
  • Docker常用指令
    Docker镜像常用命令搜索镜像dockersearchjava下载镜像dockerpulljava:8查看镜像版本dockersearch由于dockersearch命令只能查找出是否有该镜像,不能找到该镜像支持的版本,需要通过DockerHub来搜索支持的版本。进入DockerHub的官网,地址:https://hub.dock......
  • Docker学习笔记(三)Dockerfile指令详解
    文章目录FROM指定基础镜像RUN执行命令COPY复制文件ADD高级文件复制CMD容器启动命令ENTRYPOINT入口点ENV设置环境变量ARG构建参数VOLUME定义匿名卷EXPOSE声明端口WORKDIR指定工作目录USER指定当前用户HEALTHCHECK健康检查ONBUILD构建触发器LABEL添加元数据......