docker专业版 webdav配置

版本:docker 11.05
docker映射的外部端口默认为:80

1.conf目录下创建seafdav.conf,如已有请忽略(docker版本默认自带启用即可),内容如下:
[WEBDAV]
enabled = true
show_repo_id=true
port = 8080
share_name = /webdav

2.seafile-data\nginx\conf目录下的seafile.nginx.conf,内容如下(docker版本默认自带):
location /webdav {
proxy_pass http://127.0.0.1:8080;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $server_name;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_read_timeout 1200s;
client_max_body_size 0;

    access_log      /var/log/nginx/seafdav.access.log seafileformat;
    error_log       /var/log/nginx/seafdav.error.log;
}
location /:dir_browser {
    proxy_pass         http://127.0.0.1:8080/:dir_browser; #logo显示
}

3.本地http://127.0.0.1:80/webdav 应该就可以正常访问了。

4.公网2级目录访问 如htt://xx.com/webdav, nginx配置如下 :
location /webdav {
proxy_pass http://127.0.0.1:80/webdav;
proxy_set_header Host $host;

    access_log  /www/wwwlogs/xx.com.webdav.access.log;
    error_log   /www/wwwlogs/xx.com.webdav.error.log;
}
location /:dir_browser {
    proxy_pass         http://127.0.0.1:80/:dir_browser;
}

5.公网2级域名访问,webdav.xx.com, nginx配置如下:
location / {
proxy_pass http://127.0.0.1:80/webdav/;
proxy_set_header Host $host;

    access_log  /www/wwwlogs/xx.com.webdav.access.log;
    error_log   /www/wwwlogs/xx.com.webdav.error.log;
}
location /:dir_browser/ {
    proxy_pass         http://127.0.0.1:80/:dir_browser;
}
2 个赞

公网2级目录访问 如果是加了ssl和端口,例如https://xx.com:8443/webdav
nginx 的配置项如何更改咧?求指点!