mirror of
https://github.com/sigoden/dufs.git
synced 2026-04-08 16:49:02 +03:00
[GH-ISSUE #377] nginx sub dir get forbidden error #200
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @carlsue on GitHub (Apr 24, 2024).
Original GitHub issue: https://github.com/sigoden/dufs/issues/377
i setup nginx and dufs on the same device ,config nginx revers proxy to dufs ,but get forbidden error:

location /dufs { proxy_pass http://127.0.0.1:5000; }@sigoden commented on GitHub (Apr 24, 2024):
Must be misconfig on auth options. Don't include
/dufsprefix in the auth path.If it still fails, please provide the full configuration for further assistance.
@carlsue commented on GitHub (Apr 24, 2024):
config dufs 'config'
option enabled '1'
option port '5000'
option allow_upload '1'
option allow_search '1'
list auth '2:2@/sda1:rw'
list auth '1:1@/sda1/TDDOWNLOAD'
option internet '1'
option enable_cors '1'
`
worker_processes auto;
user root;
include module.d/*.module;
events {}
http {
access_log off;
log_format openwrt
'$request_method $scheme://$host$request_uri => $status'
' (${body_bytes_sent}B in ${request_time}s) <- $http_referer';
}
configuration file /etc/nginx/module.d/luci.module:
load_module /usr/lib/nginx/modules/ngx_http_ubus_module.so;
configuration file /etc/nginx/mime.types:
types {
text/html html htm shtml;
text/css css;
text/xml xml;
image/gif gif;
image/jpeg jpeg jpg;
application/javascript js;
application/atom+xml atom;
application/rss+xml rss;
}
configuration file /etc/nginx/restrict_locally:
configuration file /etc/nginx/conf.d/luci.locations:
location /cgi-bin/luci {
index index.html;
include uwsgi_params;
uwsgi_param SERVER_ADDR $server_addr;
uwsgi_modifier1 9;
uwsgi_pass unix:////var/run/luci-webui.socket;
}
location ~ /cgi-bin/cgi-(backup|download|upload|exec) {
include uwsgi_params;
uwsgi_param SERVER_ADDR $server_addr;
uwsgi_modifier1 9;
uwsgi_pass unix:////var/run/luci-cgi_io.socket;
}
location /luci-static {
error_log stderr crit;
}
location /ubus {
ubus_interpreter;
ubus_socket_path /var/run/ubus/ubus.sock;
ubus_parallel_req 2;
}
location /dufs {
proxy_pass http://127.0.0.1:5000;
}
configuration file /etc/nginx/uwsgi_params:
uwsgi_param QUERY_STRING $query_string;
uwsgi_param REQUEST_METHOD $request_method;
uwsgi_param CONTENT_TYPE $content_type;
uwsgi_param CONTENT_LENGTH $content_length;
uwsgi_param REQUEST_URI $request_uri;
uwsgi_param PATH_INFO $document_uri;
uwsgi_param DOCUMENT_ROOT $document_root;
uwsgi_param SERVER_PROTOCOL $server_protocol;
uwsgi_param REQUEST_SCHEME $scheme;
uwsgi_param HTTPS $https if_not_empty;
uwsgi_param REMOTE_ADDR $remote_addr;
uwsgi_param REMOTE_PORT $remote_port;
uwsgi_param SERVER_PORT $server_port;
uwsgi_param SERVER_NAME $server_name;
`
@sigoden commented on GitHub (Apr 24, 2024):
I don't know much nginx, you'd better leave nginx alone and see if the dufs configuration is correct.
First, do not set auth and see if dufs can be accessed normally.
Second, set auth, check if Nginx passes the Authorization header to dufs. @carlsue
@carlsue commented on GitHub (Apr 24, 2024):
@sigoden commented on GitHub (Apr 24, 2024):
I can only help with the problem of dufs. You must be involved with nginx. I can't help you.
You'd better report the issue through https://github.com/sigoden/dufs/issues/new?assignees=&labels=&projects=&template=bug_report.md
@sigoden commented on GitHub (Apr 24, 2024):
some tips if you want to run dufs with subpath
/dufs:--path-prefix /dufsoption/dufsprefix@sigoden commented on GitHub (Apr 25, 2024):
Closing this issue due to lack of information.
@carlsue commented on GitHub (Apr 27, 2024):
通过测试,发现跟nginx版本有关系。
在windows上用nginx同样配置可以成功
server
{
listen 80;
server_name 127.0.0.1;
}

但在openwrt上安装的nginx由于没有sub_filter模块,所以会有如下错误

@carlsue commented on GitHub (Apr 27, 2024):
successed! install nginx-full instade nginx in the openwrt OS.
@sigoden commented on GitHub (Apr 27, 2024):
Congratulation ✨