欧美一级特黄大片做受成人-亚洲成人一区二区电影-激情熟女一区二区三区-日韩专区欧美专区国产专区

使用docker增加nginx

使用docker增加nginx autoindex美化功能

話不多說先上效果圖,先確定是不是你想要達(dá)到的結(jié)果
使用docker增加nginx

讓客戶滿意是我們工作的目標(biāo),不斷超越客戶的期望值來自于我們對這個行業(yè)的熱愛。我們立志把好的技術(shù)通過有效、簡單的方式提供給客戶,將通過不懈努力成為客戶在信息化領(lǐng)域值得信任、有價值的長期合作伙伴,公司提供的服務(wù)項目有:域名注冊、網(wǎng)絡(luò)空間、營銷軟件、網(wǎng)站建設(shè)、谷城網(wǎng)站維護(hù)、網(wǎng)站推廣。

##安裝編譯docker 環(huán)境
我們這里采用的是nginx1.16.0 版本來進(jìn)行編譯安裝的,如果有需要你可以自行更改成別的nginx版本,Dockerfile如下

FROM alpine:latest AS alpine-base
WORKDIR /usr/local
#更換apline的源為阿里云的
RUN echo "http://mirrors.aliyun.com/alpine/latest-stable/main/" > /etc/apk/repositories && \
    echo "http://mirrors.aliyun.com/alpine/latest-stable/community/" >> /etc/apk/repositories && \
    apk update && \
#安裝wget 和git 我們?yōu)榱耸圭R像最小化這個都放在另外一個鏡像里面來實現(xiàn)
    apk add --no-cache wget git && \
#下載nginx包
    wget http://nginx.org/download/nginx-1.16.0.tar.gz && \
    tar xvf nginx-1.16.0.tar.gz && \
#克隆我們需要的模塊和主題
    git clone https://github.com/Naereen/Nginx-Fancyindex-Theme.git && \
    git clone https://github.com/aperezdc/ngx-fancyindex.git && \
    mkdir /usr/local/nginx-1.16.0/model && \
    mv ./ngx-fancyindex /usr/local/nginx-1.16.0/model/

FROM alpine:latest
MAINTAINER zhangshoufu zsf18163201@163.com
WORKDIR /root
#從上面一個鏡像中把我們剛才下載安裝的包拷貝到這個里面
COPY --from=alpine-base /usr/local/nginx-1.16.0 /usr/local/nginx-1.16.0
RUN echo "http://mirrors.aliyun.com/alpine/latest-stable/main/" > /etc/apk/repositories && \
    echo "http://mirrors.aliyun.com/alpine/latest-stable/community/" >> /etc/apk/repositories && \
    apk update && \
#安裝編譯安裝需要的依賴
    apk add --no-cache gcc libc-dev make openssl-dev pcre-dev zlib-dev linux-headers curl && \
    cd /usr/local/nginx-1.16.0/ && \
#執(zhí)行編譯安裝
    ./configure --prefix=/etc/nginx \
    --sbin-path=/usr/sbin/nginx \
    --modules-path=/usr/lib/nginx/modules \
    --conf-path=/etc/nginx/nginx.conf \
    --error-log-path=/var/log/nginx/error.log \
    --http-log-path=/var/log/nginx/access.log \
    --pid-path=/var/run/nginx.pid \
    --lock-path=/var/run/nginx.lock \
    --http-client-body-temp-path=/var/cache/nginx/client_temp \
    --http-proxy-temp-path=/var/cache/nginx/proxy_temp \
    --http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp \
    --http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp \
    --http-scgi-temp-path=/var/cache/nginx/scgi_temp \
#指定安裝擴(kuò)展模塊的位置
     --add-module=/usr/local/nginx-1.16.0/model/ngx-fancyindex \
    --with-compat \
    --with-file-aio \
    --with-threads \
    --with-http_addition_module \
    --with-http_auth_request_module \
    --with-http_dav_module \
    --with-http_flv_module \
    --with-http_gunzip_module \
    --with-http_gzip_static_module \
    --with-http_mp4_module \
    --with-http_random_index_module \
    --with-http_realip_module \
    --with-http_secure_link_module \
    --with-http_slice_module \
    --with-http_ssl_module \
    --with-http_stub_status_module \
    --with-http_sub_module \
    --with-http_v2_module \
    --with-mail \
    --with-mail_ssl_module \
    --with-stream --with-stream_realip_module \
    --with-stream_ssl_module \
    --with-stream_ssl_preread_module \
    --with-cc-opt='-g -O2 -fdebug-prefix-map=/data/builder/debuild/nginx-1.16.0/debian/debuild-base/nginx-1.16.0=. -fstack-protector-strong -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fPIC' \
    --with-ld-opt='-Wl,-z,relro -Wl,-z,now -Wl,--as-needed -pie' && \
    make && make install && \
    mkdir -p /var/cache/nginx/client_temp && \
    rm -rf /usr/local/nginx-1.16.0
#把主題拷貝到網(wǎng)站根目錄下
COPY --from=alpine-base /usr/local/./Nginx-Fancyindex-Theme /etc/nginx/html
EXPOSE 80
CMD ["/bin/sh","-c","nginx -g 'daemon off;'"]

我們執(zhí)行構(gòu)建動作

 docker build  -t apline-nginx:v2.0 -f Dockerfile .

截止目前為止我們的docker 包已經(jīng)構(gòu)建完成了,

如何使用docker包

因為我們打包的docker包里面索引主題放在了/etc/nginx/html下面,所以我們就把網(wǎng)站根目錄設(shè)在這個目錄下,然后我們通過掛載的方式把網(wǎng)站目錄掛載到這個目錄下,我們先編寫nginx.conf文件

```nginx.conf
worker_processes auto;

events {
worker_connections 1024;
}

http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;

fancyindex on;
fancyindex_exact_size off;
fancyindex_localtime on;
fancyindex_header "/Nginx-Fancyindex-Theme-light/header.html";
fancyindex_footer "/Nginx-Fancyindex-Theme-light/footer.html";
fancyindex_ignore "examplefile.html";
fancyindex_ignore "Nginx-Fancyindex-Theme-light";
fancyindex_name_length 255;

server {
    listen       80;
    server_name  localhost;

    location / {
        autoindex on;
        root   /etc/nginx/html;
        index  index.html index.htm;
    }
}

}

因為這個里面有兩套主題,一套黑的一套白的,我們上面nginx配置文件使用的是白色的主題,如果我們想使用黑色的只需要把配置文件里面的`Nginx-Fancyindex-Theme-light`更換成`Nginx-Fancyindex-Theme-dark`即可。
然后我們現(xiàn)在開始啟動這個docker 容器

```bash
docker run -id --name voice_nginx -p 9999:80 -v /home/monitor/:/etc/nginx/html/monitor -v /home/monitor/nginx.conf:/etc/nginx/nginx.conf --restart=always apline-nginx:v2.0 

啟動完成之后我們就可以在瀏覽器里面打開看到我們想要的界面了
使用docker增加nginx

分享名稱:使用docker增加nginx
當(dāng)前網(wǎng)址:http://www.aaarwkj.com/article4/pccdoe.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供域名注冊、微信小程序、關(guān)鍵詞優(yōu)化網(wǎng)頁設(shè)計公司、全網(wǎng)營銷推廣企業(yè)建站

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)

成都app開發(fā)公司
日韩国产精品亚洲欧美在线| 国产精品欧美一区二区视频 | 真做的欧美三级在线观看| 日本免费91午夜视频| 国产97精品在线播放| 日韩在线一区二区视频| 老湿机午夜十分钟视频| 日韩高清精品视频在线| 国产精品一区二区夜夜夜| 国产一区二区麻豆视频| 久激情内射婷内射蜜桃| 成人黄色av免费看| 亚洲不卡在线免费av| 国产传媒网约在线观看| 国产91黑丝在线播放| 日韩中文字幕欧美国产| 色综合色综合色综合色| 视频一区日本视频二区| 九九精品在线观看视频| 国产精品国产三级国产不产一地 | 国产午夜精品自拍视频| 在线观看午夜视频免费| 日本视频一曲二曲三曲四曲| 国产精品大全中文字幕| 极品大胸美女被啪啪的高潮| 日本高清不卡在线观看| 夜夜高潮夜夜爽免费观看| 91激情黑丝在线观看| 欧美美女午夜福利视频| 成人精品午夜福利视频| 日韩精品二区在线观看| 尤物天堂av一区二区| 日韩国产欧美色资源在线| 91麻豆精品国产91久5久久| 一区二区日韩激情在线观看视频 | 久久国产精品人妻av| 亚洲国产精品伦理在线看| 四虎免费在线高清观看| 亚洲国产视频不卡一区| 中文字幕成人乱码亚洲| 亚洲另类欧美日韩中文字幕|