upstream apidev {
  server dev:4000 max_fails=100 fail_timeout=10s;
}

server {
  listen 80;
  server_name api.local.com;

  location /static {
    root /data;
    rewrite ^/static(.*)$ $1 break;
  }

  location / {
    proxy_set_header    Accept-Encoding "";
    proxy_set_header    Host $host;
    proxy_pass          http://apidev;
#     proxy_redirect      off;
#     proxy_set_header    X-Real-IP $remote_addr;
#     proxy_set_header    X-Forwarded-For $proxy_add_x_forwarded_for;
#     proxy_set_header    X-Forwarded-Host $server_name;

    sub_filter          'localhost/static' http://$http_host/static;
    sub_filter_once     off;
    sub_filter_types    application/json;
  }
}
