折磨近一年,再一次求助seafile配置问题

nginx
个人在家里做了一个seafile服务器,关于反向代理后,外网不能上传下载,折腾了很久得不到解决,希望有高人帮忙解围。
网络环境:光猫桥接,路由器PPPOE拨号动态IP,路由器内网IP为192.168.1.1,系统是openwrt,安装了DDNS(假设www.abc.com),并且用 let’s en *scrypt获得了安全证书,外网通过4433端口以https方式访问路由器,路由器后接了一台NAS,IP为192.168.1.250,centos系统部署了seafile服务器。也就是路由器使用了nginx反向代理,seafile服务器也有nginx 反向代理。

路由器上的nginx.conf配置如下:
user root;
worker_processes auto;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 0;
client_body_buffer_size 16K;
client_header_buffer_size 1k;
client_max_body_size 10G;
large_client_header_buffers 2 1k;
gzip on;
gzip_http_version 1.1;
gzip_vary on;
gzip_comp_level 1;
gzip_proxied any;
include /etc/nginx/conf.d/*.conf;
}

conf.d文件夹下又有配置文件reverse_proxy.conf,内容如下:
server {
listen 80;
listen 443;
server_name pan.abc.com;
location / {
proxy_pass http://192.168.1.250:80;
proxy_redirect off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header Host $host:$server_port;
}
}

seafile服务器上的nginx是官方脚本安装的,配置没改动,就是默认的80端口代理到127.0.0.1:8000,/seafhttp代理到127.0.0.1:8082

现在的情况是,ISP封了80,443端口,外网只能通过https://pan.abc.com:4433/访问服务器,可以看到文件,但是不能上传下载,内网上传下载都没有问题。
网页上配置的
SERVICE_URL = http://192.168.1.250,
FILE_SERVER_ROOT = http://192.168.1.250/seafhttp

做了外网4433转到路由器443的端口映射,请教问题到底在哪里?

把网页配置的FILE_SERVER_ROOT = http://192.168.1.250/seafhttp这一项修改成FILE_SERVER_ROOT = http://pan.abc.com/seafhttp试试呢,同时把8082端口也做映射,不要修改8082这个端口。

请问是将路由192.168.1.1的8082映射到192.168.1.250:8082吗?

请问是这么映射吗?

十分感谢,您第一句话提到的FILE_SERVER_ROOT,将内网IP改为域名:端口后就解决这个问题了,8082不需要另外映射~~:+1::+1:

解决了就好,其实我也不是很明白8082这个端口通过apache/nginx反向代理以后到底需不需要映射:grinning:

8082已经通过反向代理映射成 /seafhttp目录了

8000端口映射成/根目录