我正在尝试从http auth中排除一些文件(Drupal中的Brightcove视频上传修复),但我的nginx配置无法正常工作:
location / {
auth_basic "Restricted";
auth_basic_user_file /etc/nginx/.htpasswd;
location ~* \.(3g2|3gp|asf|avi|dv|flv|f4v|m4v|mov|mp4|mpeg|mpg|mts|m2ts|qt|wmv|jpg|png|jpeg)$ {
auth_basic off;
allow all;
}
proxy_set_header Authorization "";
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_pass $ip;
}
Http auth正在运行,代理通行证正在运行,但我仍然无法上传Brightcove视频。使用apache的另一台服务器的类似配置工作正常:
AuthType Basic
AuthName "Protected Area"
AuthUserFile /etc/.htpasswd
Require valid-user
SetEnvIf REQUEST_URI \.(3g2|3gp|asf|avi|dv|flv|f4v|m4v|mov|mp4|mpeg|mpg|mts|m2ts|qt|wmv|jpg|png|jpeg)$ allow
AllowOverride All
Order deny,allow
Deny from all
Allow from env=allow
Satisfy any
有人可以帮我这个吗? 谢谢!
答案 0 :(得分:0)
这是正常的:
location / {
auth_basic "Restricted";
auth_basic_user_file /etc/nginx/.htpasswd;
proxy_set_header Authorization "";
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_pass $ip;
}
location ~* \.(3g2|3gp|asf|avi|dv|flv|f4v|m4v|mov|mp4|mpeg|mpg|mts|m2ts|qt|wmv|jpg|png|jpeg)$ {
auth_basic off;
allow all;
proxy_set_header Authorization "";
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_pass $ip;
}
我之前测试过此配置,但不知道Brightcove视频需要一些时间才能开始播放: - )