server {
  listen 8080;
  server_name localhost;

  root /usr/share/nginx/html;

  location / {
      try_files $uri index.html $uri/ =404;
  }

  location /teams/ {
    error_page 404 /teams/[id]/;
  }

  location /mail-domains/ {
    error_page 404 /mail-domains/[slug]/;
  }

  error_page 404 /404.html;
  location = /404.html {
      internal;
  }
}
