server {
    listen       80;
    access_log   /var/log/nginx/alarm-system-pages.log  main;

    root         /opt/sagacloud/app/dist;
    index        index.html;
    
    location /hyy-alarm {
        root        /data/app/pages/sagacloud-alarm-system-pages/dist;
        try_files   $uri $uri/ /hyy-alarm/index.html;
    }

    
    location ^~ /info-mng-backend/ {
       # proxy_pass              http://web02:8080;
        proxy_pass              http://api.sagacloud.cn;
        #proxy_pass              http://172.17.11.176:58080;
        proxy_set_header        Host            $host;
        proxy_set_header        X-Real-IP       $remote_addr;
        proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
        client_max_body_size    20m;
        client_body_buffer_size 128k;
        proxy_buffers           32 4k;
        proxy_connect_timeout   3;
        proxy_send_timeout      30;
        proxy_read_timeout      30;
    }
    location ^~ /common/ {
        proxy_pass              http://hyy.sagacloud.cn;
        proxy_set_header        Host            $host;
        proxy_set_header        X-Real-IP       $remote_addr;
        proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
        client_max_body_size    20m;
        client_body_buffer_size 128k;
        proxy_buffers           32 4k;
        proxy_connect_timeout   3;
        proxy_send_timeout      30;
        proxy_read_timeout      30;
    }
    location ^~ /server/ {
        proxy_pass              http://hyy.sagacloud.cn;
        proxy_set_header        Host            $host;
        proxy_set_header        X-Real-IP       $remote_addr;
        proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
        client_max_body_size    20m;
        client_body_buffer_size 128k;
        proxy_buffers           32 4k;
        proxy_connect_timeout   3;
        proxy_send_timeout      30;
        proxy_read_timeout      30;
    }

    location ^~ /image/ {
        proxy_pass              http://hyy.sagacloud.cn;
        proxy_set_header        Host            $host;
        proxy_set_header        X-Real-IP       $remote_addr;
        proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
        client_max_body_size    20m;
        client_body_buffer_size 128k;
        proxy_buffers           32 4k;
        proxy_connect_timeout   3;
        proxy_send_timeout      30;
        proxy_read_timeout      30;
        rewrite ^/image/(.+?)$ /$1 break;
    }

    location ^~ /data-platform-3 {
        proxy_pass              http://api.sagacloud.cn;
        proxy_set_header        Host            $host;
        proxy_set_header        X-Real-IP       $remote_addr;
        proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
        client_max_body_size    20m;
        client_body_buffer_size 128k;
        proxy_buffers           32 4k;
        proxy_connect_timeout   3;
        proxy_send_timeout      30;
        proxy_read_timeout      30;
    }

    location ^~ /fm-service/workorder {
        proxy_pass              http://api.sagacloud.cn;
        proxy_set_header        Host            $host;
        proxy_set_header        X-Real-IP       $remote_addr;
        proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
        client_max_body_size    20m;
        client_body_buffer_size 128k;
        proxy_buffers           32 4k;
        proxy_connect_timeout   3;
        proxy_send_timeout      30;
        proxy_read_timeout      30;
        #rewrite                 ^/fm-service/workorder/(.*) /workorder/$1 break;
    }  
 
location ^~ /dp-auxiliary/alarm-system/ {
    proxy_pass              http://api.sagacloud.cn;
    proxy_set_header        Host            $host;
    proxy_set_header        X-Real-IP       $remote_addr;
    proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
    client_max_body_size    20m;
    client_body_buffer_size 128k;
    proxy_buffers           32 4k;
    proxy_connect_timeout   3;
    proxy_send_timeout      30;
    proxy_read_timeout      30;
    #rewrite                 ^/dp-auxiliary/alarm-system/(.*) /alarm-system/$1 break;
}

location ^~ /dp-auxiliary/image-service/ {
    proxy_pass              http://api.sagacloud.cn;
    proxy_set_header        Host            $host;
    proxy_set_header        X-Real-IP       $remote_addr;
    proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
    client_max_body_size    2000m;
    client_body_buffer_size 128k;
    proxy_buffers           32 4k;
    proxy_connect_timeout   3;
    proxy_send_timeout      7200;
    proxy_read_timeout      7200;
    #rewrite                 ^/dp-auxiliary/image-service/(.*) /image-service/$1 break;
}


location ^~ /dp-auxiliary/front-api/ {
    proxy_pass              http://api.sagacloud.cn;
    proxy_set_header        Host            $host;
    proxy_set_header        X-Real-IP       $remote_addr;
    proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
    client_max_body_size    2000m;
    client_body_buffer_size 128k;
    proxy_buffers           32 4k;
    proxy_connect_timeout   3;
    proxy_send_timeout      7200;
    proxy_read_timeout      7200;
    #rewrite                 ^/dp-auxiliary/front-api/(.*) /front-api/$1 break;
}

}