upstream minio_prod {
  server 192.168.148.139:39000;
  server 192.168.148.137:39000;
  server 192.168.148.140:39000;
}

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 oss.uavcmlc.com ;
    #add_header 'Access-Control-Allow-Origin' "www.uavcmlc.com";
    location / {
        #valid_referers none *.uavcmlc.com;
        #if ($invalid_referer) {
        #    return 403;
        #}

        port_in_redirect off;
        client_max_body_size                    5120m;
        proxy_connect_timeout                   20s;
        proxy_send_timeout                      120s;
        proxy_read_timeout                      120s;
        proxy_buffering                         off;
        proxy_buffer_size                       4k;
        proxy_buffers                           4 4k;
        proxy_max_temp_file_size                1024m;
        proxy_request_buffering                 on;
        proxy_http_version                      1.1;
        proxy_cookie_domain                     off;
        proxy_cookie_path                       off;
        proxy_next_upstream                     error timeout;
        proxy_next_upstream_timeout             0;
        proxy_next_upstream_tries               3;
        proxy_redirect                          off;

        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_pass http://minio_prod;
    }
    location /minio/ {
        allow 112.19.8.120/29;
        allow 183.220.149.16/28;
        deny  all;
        proxy_pass http://minio_prod/minio/;
    }
    location /crossdomain.xml {
        allow 112.19.8.120/29;
        allow 183.220.149.16/28;
        deny  all;
    }

    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 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;
    }
}