binss / docker-nginx-webdav

10 stars 2 forks source link

我有几个问题 #1

Closed buzai closed 5 years ago

buzai commented 5 years ago

listen 443 ssl http2;

  | server_name yourhostname.com;   | ssl_certificate "your cert";   | ssl_certificate_key "your cert key";

这你开启了 https http2 ,这几行我如果 替换 ··· listen 80 ··· 就是直接可以 http 访问了对吧。

而且你的博客我认为你是在 局域网环境下的,那怎么做到 使用域名的呢,还是你还做了 dns 服务器。 还有一个问题是 docker 启动了 nginx 服务,nginx 读取的是 容器内部的 /webdav 文件夹吧,这样的话如果文件夹变大是不是会有一些问题。也不对你是挂在了外面的文件夹吧

好吧我还一个问题 并使用以下配置文件:

这个以下配置文件 是否是 本项目下的 nginx.conf 呢? 但是这个和你的博客里的conf 内容不一样我看,build 里是直接 copy 了两个文件到 etc/nignx 是否我需要 修改这个文件呢 还有那个 password 需要怎么个条件设置生成呢 如果我前面的都解决了

挂载文件夹,编写 nginx.conf 那么我需要 docker run -v /webdav /webdav -p 80:80 xxximg 来启动么 期望出一个简单的 readme

buzai commented 5 years ago

还有一些警告

% Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 992k 100 992k 0 0 14744 0 0:01:08 0:01:08 --:--:-- 12540 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 455 100 455 0 0 285 0 0:00:01 0:00:01 --:--:-- 285 Fetching GPG key B0F4253373F8F6F510D42178520A9993A1C052F8 from ha.pool.sks-keyservers.net gpg: keybox '/tmp/tmp.FkPeHA/pubring.kbx' created gpg: keyserver receive failed: No data Fetching GPG key B0F4253373F8F6F510D42178520A9993A1C052F8 from hkp://keyserver.ubuntu.com:80 gpg: key 520A9993A1C052F8: 6 signatures not checked due to missing keys gpg: /tmp/tmp.FkPeHA/trustdb.gpg: trustdb created gpg: key 520A9993A1C052F8: public key "Maxim Dounin mdounin@mdounin.ru" imported gpg: no ultimately trusted keys found gpg: Total number processed: 1 gpg: imported: 1 gpg: Signature made Tue Apr 10 14:13:01 2018 UTC gpg: using RSA key 520A9993A1C052F8 gpg: Good signature from "Maxim Dounin mdounin@mdounin.ru" [unknown] gpg: WARNING: This key is not certified with a trusted signature! gpg: There is no indication that the signature belongs to the owner. Primary key fingerprint: B0F4 2533 73F8 F6F5 10D4 2178 520A 9993 A1C0 52F8

buzai commented 5 years ago

adding module in /modules/nginx-dav-ext-module/ ./configure: error: no /modules/nginx-dav-ext-module//config was found The command '/bin/sh -c GPG_KEYS=B0F4253373F8F6F510D42178520A9993A1C052F8 && CONFIG=" --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 --user=nginx --group=nginx --with-http_ssl_module --with-http_realip_module --with-http_addition_module --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_random_index_module --with-http_secure_link_module --with-http_stub_status_module --with-http_auth_request_module --with-http_xslt_module=dynamic --with-http_image_filter_module=dynamic --with-http_geoip_module=dynamic --with-threads --with-stream --with-stream_ssl_module --with-stream_ssl_preread_module --with-stream_realip_module --with-stream_geoip_module=dynamic --with-http_slice_module --with-mail --with-mail_ssl_module --with-compat --with-file-aio --with-http_v2_module --with-http_dav_module --add-module=/modules/nginx-dav-ext-module/ --add-module=/modules/headers-more-nginx-module " && addgroup -S nginx && adduser -D -S -h /var/cache/nginx -s /sbin/nologin -G nginx nginx && apk add --no-cache --virtual .build-deps gcc libc-dev make openssl-dev pcre-dev zlib-dev linux-headers curl gnupg libxslt-dev gd-dev geoip-dev expat-dev && curl -fSL https://nginx.org/download/nginx-$NGINX_VERSION.tar.gz -o nginx.tar.gz && curl -fSL https://nginx.org/download/nginx-$NGINX_VERSION.tar.gz.asc -o nginx.tar.gz.asc && export GNUPGHOME="$(mktemp -d)" && found=''; for server in ha.pool.sks-keyservers.net hkp://keyserver.ubuntu.com:80 hkp://p80.pool.sks-keyservers.net:80 pgp.mit.edu ; do echo "Fetching GPG key $GPG_KEYS from $server"; gpg --keyserver "$server" --keyserver-options timeout=10 --recv-keys "$GPG_KEYS" && found=yes && break; done; test -z "$found" && echo >&2 "error: failed to fetch GPG key $GPG_KEYS" && exit 1; gpg --batch --verify nginx.tar.gz.asc nginx.tar.gz && rm -rf "$GNUPGHOME" nginx.tar.gz.asc && mkdir -p /usr/src && tar -zxC /usr/src -f nginx.tar.gz && rm nginx.tar.gz && cd /usr/src/nginx-$NGINX_VERSION && ./configure $CONFIG --with-debug && make -j$(getconf _NPROCESSORS_ONLN) && mv objs/nginx objs/nginx-debug && mv objs/ngx_http_xslt_filter_module.so objs/ngx_http_xslt_filter_module-debug.so && mv objs/ngx_http_image_filter_module.so objs/ngx_http_image_filter_module-debug.so && mv objs/ngx_http_geoip_module.so objs/ngx_http_geoip_module-debug.so && mv objs/ngx_stream_geoip_module.so objs/ngx_stream_geoip_module-debug.so && ./configure $CONFIG && make -j$(getconf _NPROCESSORS_ONLN) && make install && rm -rf /etc/nginx/html/ && mkdir /etc/nginx/conf.d/ && mkdir -p /usr/share/nginx/html/ && install -m644 html/index.html /usr/share/nginx/html/ && install -m644 html/50x.html /usr/share/nginx/html/ && install -m755 objs/nginx-debug /usr/sbin/nginx-debug && install -m755 objs/ngx_http_xslt_filter_module-debug.so /usr/lib/nginx/modules/ngx_http_xslt_filter_module-debug.so && install -m755 objs/ngx_http_image_filter_module-debug.so /usr/lib/nginx/modules/ngx_http_image_filter_module-debug.so && install -m755 objs/ngx_http_geoip_module-debug.so /usr/lib/nginx/modules/ngx_http_geoip_module-debug.so && install -m755 objs/ngx_stream_geoip_module-debug.so /usr/lib/nginx/modules/ngx_stream_geoip_module-debug.so && ln -s ../../usr/lib/nginx/modules /etc/nginx/modules && strip /usr/sbin/nginx* && strip /usr/lib/nginx/modules/*.so && rm -rf /usr/src/nginx-$NGINX_VERSION && apk add --no-cache --virtual .gettext gettext && mv /usr/bin/envsubst /tmp/ && runDeps="$( scanelf --needed --nobanner --format '%n#p' /usr/sbin/nginx /usr/lib/nginx/modules/*.so /tmp/envsubst | tr ',' '\n' | sort -u | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' )" && apk add --no-cache --virtual .nginx-rundeps $runDeps && apk del .build-deps && apk del .gettext && mv /tmp/envsubst /usr/local/bin/ && apk add --no-cache tzdata && ln -sf /dev/stdout /var/log/nginx/access.log && ln -sf /dev/stderr /var/log/nginx/error.log' returned a non-zero code: 1

buzai commented 5 years ago

貌似 build fail

buzai commented 5 years ago

ok build 基本成功了 我忘记了clone 子项目

但是有个 警告不知道正常么

WARNING: Ignoring APKINDEX.70c88391.tar.gz: No such file or directory WARNING: Ignoring APKINDEX.5022a8a2.tar.gz: No such file or directory

binss commented 5 years ago
  1. 对,去掉 ssl http2 则使用 http
  2. 何以见得是局域网环境?
  3. /webdav 目录挂载的是宿主机的目录,该目录除了被该容器所挂载,还被 aria2 容器挂载作为下载的目标文件夹
  4. 当然需要 docker run 来启动...建议了解下 docker 的基本使用方法
  5. docker build 过程中上述警告可以不管
buzai commented 5 years ago

啊哈哈我已经搞好了多谢 @binss