http {
include mime.types;
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
add_header 'Access-Control-Allow-Credentials' 'true';
default_type application/octet-stream;
map $http_origin $corsHost {
"~http://127.0.0.1:8080" http://127.0.0.1:8080:8080;
}