Your comments

Thanks for the reply, I've seen that document and that's how my nginx conf is set up. I figured out that my original problem was because i didn't understand that just the main page was at / and all the urls really are /ajenti:whatever, hence the two rewrite rules. However, I can't login. I was getting "Bad origin" until I added the proxy_set_header Origin, but now I get nothing when I load it.