0

Changing Ajenti's webroot (ie my.domain/ajenti)

nick 9 years ago updated 9 years ago 2
I'm trying to set up ajenti behind an nginx reverse proxy. The instructions say all URLs are /ajenti, but mine don't seem to be and if I go to myhost:8000/ajenti I get "invalid URL." It's possible that I changed something to get rid of /ajenti but I don't remember what (if anything) I would've done and can't find documentation about that.
+1
If you wann use , my.domain/ajenti
you should follow this config

server { 
    client_max_body_size 20m; 
    location ~ /ajenti.* { 
        rewrite (/ajenti)$ / break; 
        rewrite /ajenti/(.*) /$1 break; 
        proxy_pass http://127.0.0.1:8000; 
        proxy_redirect / /ajenti/; 
        proxy_set_header Host $host; 
        proxy_set_header Origin http://$host; 
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 
        proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; 
        proxy_set_header Connection $http_connection; 
    } 
}
You can further improve performance by making Ajenti listen on a UNIX socket. For that, set Host in Configure > General to something like /var/run/ajenti.sock, and replace <code>proxy_pass URL with http://unix:/var/run/ajenti.sock

http://support.ajenti.org/topic/349870-ajenti-behind-nginx/
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.