Skip to content

Instantly share code, notes, and snippets.

@allanice001
Created May 18, 2016 20:36
Show Gist options
  • Save allanice001/2e9b55b174b7a320276b86b876978c1b to your computer and use it in GitHub Desktop.
Save allanice001/2e9b55b174b7a320276b86b876978c1b to your computer and use it in GitHub Desktop.
Nginx Ajenti Working reverse proxy
=== /etc/ajenti/config.json ===
{
"users": {
"root": {
"configs": {
"ajenti.plugins.notepad.notepad.Notepad": "{\"bookmarks\": [], \"root\": \"/\"}",
"ajenti.plugins.terminal.main.Terminals": "{\"shell\": \"sh -c $SHELL || bash\"}",
"ajenti.plugins.logs.main.Logs": "{\"root\": \"/var/log\"}",
"ajenti.plugins.dashboard.dash.Dash": "{\"widgets\": [{\"index\": 0, \"config\": null, \"container\": \"1\", \"class\": \"ajenti.plugins.sensors.memory.MemoryWidget\"}, {\"index\": 1, \"config\": null, \"container\": \"1\", \"class\": \"ajenti.plugins.sensors.memory.SwapWidget\"}, {\"index\": 2, \"config\": null, \"container\": \"1\", \"class\": \"ajenti.plugins.dashboard.welcome.WelcomeWidget\"}, {\"index\": 0, \"config\": null, \"container\": \"0\", \"class\": \"ajenti.plugins.sensors.uptime.UptimeWidget\"}, {\"index\": 1, \"config\": null, \"container\": \"0\", \"class\": \"ajenti.plugins.power.power.PowerWidget\"}, {\"index\": 2, \"config\": null, \"container\": \"0\", \"class\": \"ajenti.plugins.sensors.cpu.CPUWidget\"}]}",
"ajenti.plugins.mysql.api.MySQLDB": "{\"password\": \"mysql_root_password_here\", \"user\": \"root\", \"hostname\": \"localhost\"}",
"ajenti.plugins.fm.fm.FileManager": "{\"start\": \"/\", \"root\": \"/\"}",
"ajenti.plugins.mongo.api.MongoDB": "{\"url\": \"mongodb://localhost:27017/\"}",
"ajenti.plugins.tasks.manager.TaskManager": "{\"task_definitions\": []}",
"ajenti.users.UserManager": "{\"sync-provider\": \"\"}"
},
"password": "sha512|reallylongstringhere",
"email": "your@email.address.here",
"permissions": []
}
},
"language": "",
"bind": {
"host": "/var/run/ajenti.sock",
"port": 8000
},
"enable_feedback": true,
"ssl": {
"enable": false,
"certificate_path": "/path/to/your/ajenti.pem"
},
"authentication": true,
"installation_id": 219024
}
=== /etc/nginx.custom.d/panel.example.com.conf ===
server {
listen 80;
server_name panel.example.com;
add_header Strict-Transport-Security max-age=2592000;
rewrite ^/.*$ https://panel.example.com/ permanent;
}
server {
listen 443;
server_name panel.example.com;
client_max_body_size 200m;
access_log /var/log/nginx/ajenti-access.log;
error_log /var/log/nginx/ajenti-error.log;
ssl on;
ssl_certificate /path/to/your/cert/fullchain.pem;
ssl_certificate_key /path/to/your/cert//privkey.pem;
keepalive_timeout 60;
ssl_ciphers HIGH:!ADH:!MD5;
ssl_protocols SSLv3 TLSv1;
ssl_prefer_server_ciphers on;
proxy_buffers 16 64k;
proxy_buffer_size 128k;
location /ajenti {
rewrite (/ajenti)$ / break;
rewrite /ajenti/(.*) /$1 break;
proxy_pass http://unix:/var/run/ajenti.sock;
proxy_redirect / /ajenti/;
proxy_set_header Host $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;
proxy_set_header Origin http://$host;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment