Skip to content
反向代理说明



📚修改配置文件内容

半代理配置

半代理只代理后台 前端靠nginx 节省webos程序开销 极大提升性能

提示:半代理需要配合宝塔或者其他网站管理工具实现

推荐使用半代理

location ~* ^/(webos|s|sp|s3bucket|kkfile)
{
    proxy_pass http://127.0.0.1:8088$request_uri;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection Upgrade;
    proxy_set_header   X-Real-IP   $remote_addr;
    proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_connect_timeout 3600s;
    proxy_read_timeout 3600s;
    proxy_send_timeout 3600s;
    client_max_body_size 100m;
    proxy_set_header Range $http_range;
    proxy_set_header Host $host;
}
location ~* ^/(webos|s|sp|s3bucket|kkfile)
{
    proxy_pass http://127.0.0.1:8088$request_uri;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection Upgrade;
    proxy_set_header   X-Real-IP   $remote_addr;
    proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_connect_timeout 3600s;
    proxy_read_timeout 3600s;
    proxy_send_timeout 3600s;
    client_max_body_size 100m;
    proxy_set_header Range $http_range;
    proxy_set_header Host $host;
}

全代理配置

全代理后台和前端都走nginx和webos程序 性能偏差

location ^~ /
{
    proxy_pass http://127.0.0.1:8088$request_uri;
    proxy_http_version 1.1;
    proxy_set_header Origin $http_origin;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection Upgrade;
    proxy_set_header   X-Real-IP   $remote_addr;
    proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_connect_timeout 3600s;
    proxy_read_timeout 3600s;
    proxy_send_timeout 3600s;
    client_max_body_size 100m;
    proxy_set_header Range $http_range;
    proxy_set_header Host $host;
}
location ^~ /
{
    proxy_pass http://127.0.0.1:8088$request_uri;
    proxy_http_version 1.1;
    proxy_set_header Origin $http_origin;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection Upgrade;
    proxy_set_header   X-Real-IP   $remote_addr;
    proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_connect_timeout 3600s;
    proxy_read_timeout 3600s;
    proxy_send_timeout 3600s;
    client_max_body_size 100m;
    proxy_set_header Range $http_range;
    proxy_set_header Host $host;
}

至此结束


Webos 官方文档