首页 > 解决方案 > 在 Alpine nginx docker 镜像上设置 fancyindex

问题描述

我正在尝试在 Nginx Alpine docker 映像上设置 fancyindex。我有以下

FROM nginx:alpine

RUN apk update

RUN apk add  nginx-mod-http-fancyindex \
        --repository https://alpine.global.ssl.fastly.net/alpine/edge/community \
        --repository https://alpine.global.ssl.fastly.net/alpine/edge/main \
        --repository https://dl-3.alpinelinux.org/alpine/edge/testing

RUN rm -rf /usr/share/nginx/html/*

COPY nginx.conf /etc/nginx/

EXPOSE 80

CMD [ "nginx" ]

在顶部的 nginx.conf 文件中,我添加了一行

load_module "/usr/lib/nginx/modules/ngx_http_fancyindex_module.so";

但我看到一个错误

1#1: module "/usr/lib/nginx/modules/ngx_http_fancyindex_module.so" version 1020001 instead of 1021000 in /etc/nginx/nginx.conf:1
nginx: [emerg] module "/usr/lib/nginx/modules/ngx_http_fancyindex_module.so" version 1020001 instead of 1021000 in /etc/nginx/nginx.conf:1

我该如何解决这个问题?我在设置fancyindex的正确道路上吗?

标签: dockernginxalpine

解决方案


推荐阅读