
#server {
#    listen 443 ssl   ;
#    listen [::]:443 ssl    ;
#    include /etc/nginx/conf.d/ssl_settings/ssl-x-uavcmlc.conf;
#    include /etc/nginx/conf.d/ssl_settings/error-template.conf;
#    server_name s.uavcmlc.com;
#    rewrite ^(.*)$ https://s.uavcmlc.com:443$1 permanent;
#    error_page 497 301 https://s.uavcmlc.com:443$1;
#}


upstream  k8s_cluster {
    ip_hash;
    #server 192.168.148.132:30500;
    #server 192.168.148.130:30500;
    server 192.168.148.160:30500;
    #server 192.168.148.161:30500;
    #server 192.168.148.162:30500;
    #server 192.168.148.170:30500;
    server 192.168.148.170:30500;
    server 192.168.148.173:30500;


}


server {
    listen 443 ssl;
    listen [::]:443 ssl;
    include /etc/nginx/conf.d/ssl_settings/ssl-x-uavcmlc.conf;
    include /etc/nginx/conf.d/ssl_settings/error-template.conf;
    server_name s.uavcmlc.com;

    # 淇CSRF婕?    valid_referers none blocked server_names;
    if ($invalid_referer) {
           return 403;
    }

    location / {
        proxy_pass http://k8s_cluster/;
        client_max_body_size 5120m;
        client_body_buffer_size 5120m;
        client_body_timeout 6000s;
        proxy_send_timeout 10000s;
        proxy_read_timeout 10000s;
        proxy_connect_timeout 600s;
        proxy_max_temp_file_size 5120m;
        proxy_request_buffering on;
        proxy_buffering off;
        proxy_buffer_size 4k;
        proxy_buffers 4 12k;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    }

    location /_AMapService/v4/map/styles {
        set $args "$args&jscode=cf66cea95bdcdfcf8048456b36f357a1";
        proxy_pass https://webapi.amap.com/v4/ap/styles;
    }

    location /_AMapService/ {
        set $args "$args&jscode=cf66cea95bdcdfcf8048456b36f357a1";
        proxy_pass https://restapi.amap.com/;
    }


    location ~ ^/.*/(actuator|swagger-resources|api-docs|env|ping|health)(/|$) {
        return 403;
    }
    error_page 404 /404.html;

}

server {
    listen 443 ssl    ;
    listen [::]:443 ssl    ;
    include /etc/nginx/conf.d/ssl_settings/ssl-x-uavcmlc.conf;
    server_name slive.uavcmlc.com;

    add_header Access-Control-Allow-Methods 'GET, POST, OPTIONS';
    add_header Access-Control-Allow-Headers 'DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization';

    #proxy_ignore_client_abort on;

    location / {
        proxy_pass http://k8s_cluster/;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        #proxy_pass http://192.168.148.130:38080/;
    }
}

server {
    listen 443 ssl    ;
    listen [::]:443 ssl    ;
    include /etc/nginx/conf.d/ssl_settings/ssl-x-uavcmlc.conf;
    server_name soss.uavcmlc.com;

    ignore_invalid_headers off;
    proxy_buffering off;
    client_max_body_size 1024m;
    client_body_buffer_size 1024m;
    sendfile            on;
    send_timeout 600;
    tcp_nopush          on;
    tcp_nodelay         on;
    keepalive_timeout   600;
    types_hash_max_size 2048;

    location / {
        proxy_set_header Host $http_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_connect_timeout 300;
        proxy_http_version 1.1;
        proxy_set_header Connection "";
        chunked_transfer_encoding off;

        proxy_pass http://192.168.148.141:9000;
    }
}
server {
  listen 443 ssl    ;
  listen [::]:443 ssl    ;
  include /etc/nginx/conf.d/ssl_settings/ssl-x-uavcmlc.conf;
  server_name soss-cs.uavcmlc.com;

  client_max_body_size    5120m;
  client_body_buffer_size 5120m;

  location / {
    proxy_set_header Host $http_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_http_version 1.1;
    proxy_pass http://192.168.148.141:9001;
  }
}
