I need to setup nginx to rewrite URL's from example.com/page1/page2 to example.com/#page1/page2, in order to make backbone.js´s Routing work.
Basically it's all about the # that needs to be appended after the first slash in the URL to make it work.
But how do I do that? I can't really find any good example online.
The current nginx configuration:
location / {
root /var/www/frontend;
try_files $uri $uri/ @rewrites;
}
location @rewrites {
rewrite ^/~(.*)/(.*)/? /index.html#$1/$2 last;
}