server {
  access_log <%= scope.lookupvar "nginx::config::logdir" %>/<%= @name %>.access.log main;
  listen 80;
  root <%= scope.lookupvar "boxen::config::srcdir" %>/<%= @name %>/output/package;
  server_name <%= @server_name %> *.<%= @server_name %>;

  client_max_body_size 50M;
  error_page 500 502 503 504 /50x.html;

  location = /50x.html {
    root html;
  }

  try_files $uri/index.html $uri @<%= @server_name %>;
}

server {
  access_log <%= scope.lookupvar "nginx::config::logdir" %>/devppm.daptiv.com.access.log main;
  listen 80;
  server_name devppm.daptiv.com;

  client_max_body_size 50M;

  location /spa {
    autoindex on;
    alias <%= scope.lookupvar "boxen::config::srcdir" %>/<%= @name %>/output/package/;
  }

  location / {
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header Host $http_host;
    proxy_redirect off;
    proxy_pass http://localvm.daptiv.com:80;
  }
}

server {
  access_log <%= scope.lookupvar "nginx::config::logdir" %>/<%= @name %>.access.log main;
  listen 80;
  root <%= scope.lookupvar "boxen::config::srcdir" %>/<%= @name %>/output/package;
  server_name <%= @server_name %> *.<%= @server_name %>;

  client_max_body_size 50M;
  error_page 500 502 503 504 /50x.html;

  location = /50x.html {
    root html;
  }

  location /_api/ {
    proxy_pass http://unix:/tmp/ppmspamock.sock;
    rewrite /_api/(.*) /$1 break;
  }

  try_files $uri/index.html $uri @<%= @server_name %>;
}

server {
  access_log <%= scope.lookupvar "nginx::config::logdir" %>/devppm.daptiv.com.access.log main;
  listen 80;
  server_name devppm.daptiv.com;

  client_max_body_size 50M;

  location /spa {
    autoindex on;
    alias <%= scope.lookupvar "boxen::config::srcdir" %>/<%= @name %>/output/package/;
  }

  location / {
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header Host $http_host;
    proxy_redirect off;
    proxy_pass http://localvm.daptiv.com:80;
  }
}

Add _api proxy to point to node server running through unix socket
Add _api proxy to point to node server running through unix socket
