0

我在Plesk虛擬機(公共)後面運行seafile vm(專用網絡)。nginx proxy_pass並重寫海文件代理

現在我使用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; 
} 

我在這裏錯過了什麼?下面

感謝 最大

回答

0

修復:

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; 
}