server {
    listen          80;
    listen      [::]:80;
    server_name   localhost;

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

    location /prod-api/ {
        proxy_set_header Host $http_host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header REMOTE-HOST $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_pass http://localhost:8080/;
        proxy_connect_timeout 6000s;
        proxy_read_timeout  6000s;
        proxy_send_timeout  6000s;
    }

    location /profile/ {
        proxy_set_header Host $http_host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header REMOTE-HOST $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_pass http://localhost:8080/profile/;
        client_max_body_size  100m;
        client_body_buffer_size 256k;
        proxy_connect_timeout 6000s;
        proxy_read_timeout  6000s;
        proxy_send_timeout  6000s;
        proxy_buffer_size  32k;
        proxy_buffers   4 64k;
        proxy_busy_buffers_size 128k;
        proxy_temp_file_write_size 10m;
    }

    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
        root   /usr/share/nginx/html;
    }
}
