WebCal
Ctrl K

가이드

Load Balancing

가이드통합FAQ지원
가격블로그
빠른 시작Top-Up and BillingAccelerating Access to Academic ResourcesQuick StartIntroductionMaintenance and TroubleshootingNetwork
플랫폼JetBrain ProjectorTmpWebCal Scholars Program @2026Introduction to the Public Beta/Suqian Zone AAbout UsCopying Data Between InstancesAnalysis of Server Performance MetricsTidal Computing PowerLoad Balancing
중국산 칩Using Huawei MindIEHuawei Ascend NPUMooreThread GPU
환경 설정CUDA/cuDNNMinicondaPython3.XInstalling DependenciesOverviewImages
엔터프라이즈 기능Flexible DeploymentElastic Deployment Release NotesBest Practices for Elastic DeploymentPerformance Metrics Monitoring
컨테이너 인스턴스JupyterLabRemote SSH ConnectionSave the imageScaling ConfigurationMulti-machine, multi-GPU parallel processingDaemonOverviewChange the billing methodMigration Example (Same Region)Migration ExamplesRemote DesktopReset the system
GPU 선택GPU SelectionPerformance Testing
데이터Upload DataDownload DataPublic DataPublic Cloud Storage (Highly Recommended)Compression / DecompressionFile StorageLocal data diskOverview
모범 사례FileZillaGitGromacsHuggingFaceKataGoLinux BasicsMPIOpenCLPyCharm Remote DevelopmentR (RStudio) InstallationSSH TunnelTensorBoardRemote Development with VSCodeVisdomVulkanXShellOpen PortsWeChat MessagesPerformanceExpose multiple servicesMoney-Saving TipsComputation Precision IssuesSoftware Sources

플랫폼

Load Balancing

2026. 07. 30.69244회 조회

If you have launched services on different instances and are using Nginx to load balance these services, you may encounter a 404 error when directly using Nginx Upstream for proxying.The reason is as follows: Since WebCal needs to route requests to different instances based on the Host header in the user’s request (you’ll notice that the domain names in the URLs of different instances are different; under normal circumstances, the domain name from which the request originates is set in the Host header),when using Nginx to proxy multiple backend services, the address of the user’s frontend request is that of the server hosting Nginx. However, when Nginx forwards the request to WebCal, it cannot reset the Host variable in the request headers to WebCal’s domain name, resulting in failed access.Below are two methods for implementing proper proxying: 1. A workaround approach, suitable for scenarios with a small number of services to proxy; 2. A method using Lua scripts, which is more versatile but also more complex.

A More Clever Approach

server {
  listen      8001 default_server;
  server_name a.example.com;
  location / {
    proxy_set_header Host a.cqa1.seetacloud.com:8443;
    proxy_pass       https://a.cqa1.seetacloud.com:8443;
  }
}

server {
  listen      8002 default_server;
  server_name b.example.com;
  location / {
    proxy_set_header Host b.cqa1.seetacloud.com:8443;
    proxy_pass       https://b.cqa1.seetacloud.com:8443;
  }
}

upstream main_balancer {
  server 127.0.0.1:8001;
  server 127.0.0.1:8002;
}

server {
  listen      80;
  server_name example.com;
  location / {
    proxy_pass http://main_balancer;
  }
}

Using Lua Scripts

Nginx Configuration

server {
  listen      8000 default_server;
  server_name web1.example.com;
  location / {
    set $proxy_pass_target "";
    set_by_lua_file $proxy_pass_target /usr/local/openresty/nginx/lua/xxxxxx.lua;
    if ($proxy_pass_target = ""){
        return 404;
    }
    proxy_set_header Host $proxy_pass_target;
    proxy_pass       https://$proxy_pass_target;
  }
}

Lua scripts

local servers = {
    ["0"] = "a.cqa1.seetacloud.com:8443",
    ["1"] = "b.cqa1.seetacloud.com:8443",
    ["2"] = "c.cqa1.seetacloud.com:8443",
}
local path = ngx.var.uri
local target = ""

if path == "/api/v1" then
    target = "api_v1.example.com"
elseif path == "/api/v2" then
    target = "api_v2.example.com"
else
    target = "default.api.example.com"
end

return target
다음 글R (RStudio) Installation
Compute Rental 문서가이드(으)로 돌아가기