1

我在 Plesk vm(公共)后面运行 seafile vm(私有网络)。

现在我正在使用 apache 作为代理,但想知道如何让这个设置只在 nginx 上运行。

这有效:

RewriteEngine On

ProxyPass /seafhttp http://192.168.10.102:8082
ProxyPassReverse /seafhttp http://192.168.10.102:8082
RewriteRule ^/seafhttp - [QSA,L]

RewriteRule ^/(.*) http://192.168.10.102:8000/$1 [P]
ProxyPassReverse  / http://192.168.10.102:8000/

这不会:

location /seafhttp {
    rewrite ^/seafhttp(.*)$ $1 break;
    proxy_pass http://192.168.10.102:8082;
    client_max_body_size 0;
    proxy_connect_timeout  36000s;
    proxy_read_timeout  36000s;
    proxy_send_timeout  36000s;
    send_timeout  36000s;
}

location ~ / {
    proxy_pass http://192.168.10.101:8065;
}

但这再次起作用:

RewriteEngine On

RewriteRule ^/(.*) http://192.168.10.102:8000/$1 [P]
ProxyPassReverse  / http://192.168.10.102:8000/

+

location /seafhttp {
    rewrite ^/seafhttp(.*)$ $1 break;
    proxy_pass http://192.168.10.102:8082;
    client_max_body_size 0;
    proxy_connect_timeout  36000s;
    proxy_read_timeout  36000s;
    proxy_send_timeout  36000s;
    send_timeout  36000s;
}

我在这里想念什么?

谢谢马克斯

4

1 回答 1

1

修复如下:

location ^~ /seafhttp {
    rewrite ^/seafhttp(.*)$ $1 break;
    proxy_pass http://192.168.10.102:8082;
    client_max_body_size 0;
    proxy_connect_timeout  36000s;
    proxy_read_timeout  36000s;
    proxy_send_timeout  36000s;
    send_timeout  36000s;
}

location ~ / {
    proxy_pass http://192.168.10.102:8000;
}
于 2016-06-16T18:20:56.043 回答