Skip to content

Instantly share code, notes, and snippets.

@brianjking
Forked from wieshka/ajenti.conf
Created February 19, 2016 00:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brianjking/3fa380cfd8e2b9c88b7f to your computer and use it in GitHub Desktop.
Save brianjking/3fa380cfd8e2b9c88b7f to your computer and use it in GitHub Desktop.
Working NGINX configuration for Ajenti reverse proxy
server {
listen *:443 ssl;
listen *:80;
ssl_certificate /etc/self-signed-ssl/cert.crt;
ssl_certificate_key /etc/self-signed-ssl/cert.key;
server_name FQDN;
access_log /var/log/nginx/ajenti-web-panel.access.log;
error_log /var/log/nginx/ajenti-web-panel.error.log;
root /srv/new-website;
index index.html index.htm index.php;
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 "upgrade";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment