Nginx as reverse proxy for Ajenti
EDIT: Adding proxy_set_header Origin http://$host;
fixes it for me.
After upgrading to the latest version of ajenti I also have this problem as well. Error 403 Invalid Origin. This is my setup.
server { listen 443 ssl; server_name ajenti.mymagicalwebsite.com; ssl on; if ($scheme = http) { return 301 https://$server_name$request_uri; } location / { proxy_pass http://localhost:8000; proxy_redirect off; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; 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 "upgrade"; proxy_read_timeout 36000s; ## Timeout after 10 hours }}
Funny that it all worked a version ago with this exact same setup.
Here's how I would do it:
Use location ~ /ajenti.*
instead to match Ajenti's resources URLs.
Edit: tested that and it works.