server {
listen 80;
set $host_path "/path/to/your/app";
root $host_path;
index index.html;
# SEO
if ($args ~ "_escaped_fragment_=/?(.+)") {
set $path $1;
rewrite ^ /snapshots/$path last;
}
# Re-route nested routes through index
location / {
try_files $uri $uri/ /index.html =404;
}
}
...
<head>
<!--use absolute paths for file refs-->
<link rel="stylesheet" href="/styles/main.css">
...
<base href="/">
...
</head>
...
app.config(function (...) {
$locationProvider.html5Mode(true);
$locationProvider.hashPrefix = '!';
...
});