server {
    listen       ${UI_PORT};
    listen  [::]:${UI_PORT};
    server_name  localhost;
    client_max_body_size 30m;
    gzip on;
    gzip_types text/plain text/css application/json application/javascript application/x-javascript text/xml application/xml application/rss+xml text/javascript application/vnd.ms-fontobject application/x-font-ttf font/opentype image/jpeg image/png image/svg+xml image/x-icon;
    
    include /etc/nginx/conf.d/headers.conf;

    location =/ {
        root   /usr/share/nginx/html;
        include /etc/nginx/conf.d/headers.conf;
        add_header Cache-Control no-cache;
        expires 0;
        try_files /index.html =404;
    }

    location / {
        root   /usr/share/nginx/html;
        index  index.html index.htm;
        try_files $uri $uri/ @index;
    }

    location @index {
        root   /usr/share/nginx/html;
        include /etc/nginx/conf.d/headers.conf;
        add_header Cache-Control no-cache;
        expires 0;
        try_files /index.html =404;
    }


    location /apiUrl {
        include /etc/nginx/conf.d/headers.conf;
        add_header Cache-Control "no-cache";
        rewrite ^/apiUrl/(.*) /$1  break;
        proxy_pass   ${API_URL};
    }


    location /stream/version {
        include /etc/nginx/conf.d/headers.conf;
        add_header Cache-Control "no-cache";
        proxy_set_header Connection '';
        proxy_http_version 1.1;
        chunked_transfer_encoding off;
        proxy_pass   ${API_URL};
    }

    location /televersement {
        include /etc/nginx/conf.d/headers.conf;
        add_header Cache-Control "no-cache";
        proxy_pass   ${API_URL};
    }

}