################################################################################
# bnt.reghao.cn
################################################################################
server {
   listen 80;
   server_name bnt.reghao.cn;
   access_log off;

   location / {
      proxy_set_header HOST $host;
      proxy_set_header X-Real-IP $remote_addr;
      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
      proxy_set_header X-Forwarded-Proto $scheme;

      proxy_pass http://127.0.0.1:4030;
   }
   location /ws {
      proxy_set_header Upgrade $http_upgrade;
      proxy_set_header Connection $connection_upgrade;
      proxy_cache off;
      proxy_http_version 1.1;
      proxy_buffering off;
      proxy_read_timeout 100s;
      proxy_set_header Host $host;
      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
      proxy_set_header X-Forwarded-Proto $scheme;

      proxy_pass http://127.0.0.1:4030;
   }
}

################################################################################
# oss.reghao.cn
################################################################################
server {
   listen 80;
   server_name oss.reghao.cn;
   access_log off;

   location / {
      proxy_set_header HOST $host;
      proxy_set_header X-Real-IP $remote_addr;
      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
      proxy_set_header X-Forwarded-Proto $scheme;

      proxy_pass http://127.0.0.1:4010;
   }
}

################################################################################
# api.reghao.cn
################################################################################
server {
   listen 80;
   server_name api.reghao.cn;
   access_log off;

   location / {
      proxy_set_header HOST $host;
      proxy_set_header X-Real-IP $remote_addr;
      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
      proxy_set_header X-Forwarded-Proto $scheme;
      proxy_send_timeout 600;
      proxy_read_timeout 600;
      proxy_connect_timeout 600;

      proxy_pass http://127.0.0.1:6000;
   }
   location /api/data/video/hot {
      proxy_http_version 1.1;
      proxy_set_header Connection "";
      proxy_set_header X-Real-IP $remote_addr;
      proxy_set_header Host $host;
      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
      proxy_read_timeout 86400s;
      proxy_buffering off;
      proxy_cache off;

      proxy_pass http://127.0.0.1:6000;
   }
   location /ws {
      proxy_set_header Upgrade $http_upgrade;
      proxy_set_header Connection $connection_upgrade;
      proxy_cache off;
      proxy_http_version 1.1;
      proxy_buffering off;
      proxy_read_timeout 100s;
      proxy_set_header Host $host;
      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
      proxy_set_header X-Forwarded-Proto $scheme;

      proxy_pass http://127.0.0.1:6000;
   }
}

################################################################################
# tnb.reghao.cn
################################################################################
server {
   listen 80;
   server_name tnb.reghao.cn;
   access_log off;

   root tnbapp/dist;
   location / {
      try_files $uri $uri/ /index.html;
   }
}

# server {
#    listen 80;
#    server_name tnb1.reghao.cn;
#    access_log off;

#    location / {
#       proxy_set_header HOST $host;
#       proxy_set_header X-Real-IP $remote_addr;
#       proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
#       proxy_set_header X-Forwarded-Proto $scheme;

#       proxy_pass http://127.0.0.1:8000;
#    }
# }
