Files
iOSBuildServer/outputs/nginx-webdav.conf.example

50 lines
1.3 KiB
Plaintext

# 保存为 /etc/nginx/conf.d/app-downloads.conf。
# 文件服务器内网地址:172.1.110.13
# 请将 Android 打包服务器来源 IP 也加入 WebDAV allow 列表。
# 内网 WebDAV:构建服务器通过 PUT 上传、DELETE 删除。
server {
listen 172.1.110.13:8080;
server_name _;
root /home/appmgr/app-downloads;
client_max_body_size 5g;
client_body_timeout 300s;
auth_basic "Build Artifacts";
auth_basic_user_file /etc/nginx/app-downloads.htpasswd;
# iOS 打包服务器;将 Android 打包服务器来源 IP 也加入 allow 列表。
allow 172.1.110.180;
deny all;
location / {
dav_methods PUT DELETE MKCOL;
create_full_put_path on;
dav_access user:rw group:r;
autoindex off;
# 兼容当前 iOS 打包服务 MKCOL 请求尾部斜杠。
if ($request_method = MKCOL) {
rewrite ^(.*[^/])$ $1/ break;
}
}
}
# 内层静态文件服务:由外层 Nginx 反向代理;不要对公网开放 8081。
server {
listen 172.1.110.13:8081;
server_name _;
root /home/appmgr/app-downloads;
autoindex off;
location / {
dav_methods off;
limit_except GET HEAD {
deny all;
}
try_files $uri =404;
}
}