STF配置Nginx

nginx.conf

daemon off;
worker_processes 4;

events {
  worker_connections 1024;
}

http {
  upstream stf_app {
    server 192.168.3.85:3100 max_fails=0;
  }

  upstream stf_auth {
    server 192.168.3.85:3200 max_fails=0;
  }

  upstream stf_storage_apk {
    server 192.168.3.85:3300 max_fails=0;
  }

  upstream stf_storage_image {
    server 192.168.3.85:3400 max_fails=0;
  }

  upstream stf_storage {
    server 192.168.3.85:3500 max_fails=0;
  }

  upstream stf_websocket {
    server 192.168.3.85:3600 max_fails=0;
  }

  upstream stf_api {
    server 192.168.3.85:3700 max_fails=0;
  }

  types {
    application/javascript  js;
    image/gif               gif;
    image/jpeg              jpg;
    text/css                css;
    text/html               html;
  }

  map $http_upgrade $connection_upgrade {
    default  upgrade;
    ''       close;
  }

  server {
    listen 80;
    server_name 192.168.3.85;
    keepalive_timeout 70;
    root /dev/null;

    resolver 127.0.0.1 valid=300s;
    resolver_timeout 10s;

    # Handle [email protected]
    location ~ "^/d/floor4/([^/]+)/(?[0-9]{5})/$" {
      proxy_pass http://10.10.23.60:$port/;
      proxy_http_version 1.1;
      proxy_set_header Upgrade $http_upgrade;
      proxy_set_header Connection $connection_upgrade;
      proxy_set_header X-Forwarded-For $remote_addr;
      proxy_set_header X-Real-IP $remote_addr;
    }


    location /auth/ {
      proxy_pass http://stf_auth/auth/;
    }

    location /api/ {
      proxy_pass http://stf_api/api/;
    }


    location /s/image/ {
      proxy_pass http://stf_storage_image;
    }

   location /s/apk/ {
      proxy_pass http://stf_storage_apk;
    }

    location /s/ {
      client_max_body_size 1024m;
      client_body_buffer_size 128k;
      proxy_pass http://stf_storage;
    }

    location /socket.io/ {
      proxy_pass http://stf_websocket;
      proxy_http_version 1.1;
      proxy_set_header Upgrade $http_upgrade;
      proxy_set_header Connection $connection_upgrade;
      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
      proxy_set_header X-Real-IP $http_x_real_ip;
    }

    location / {
      proxy_pass http://stf_app;
      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
      proxy_set_header X-Real-IP $http_x_real_ip;
    }
  }
}

你可能感兴趣的:(STF配置Nginx)