Your comments

My existing config is listed below

server {
    listen 80;
    server_name {cp.domain.com};
    return 301 https://$host$request_uri;
}
server {
    listen 443;
    server_name {cp.domain.com};
    client_max_body_size 20m;
    access_log /var/log/nginx/ajenti.access.log;
    error_log  /var/log/nginx/ajenti.error.log;
    ssl_certificate           /etc/nginx/server.crt;
    ssl_certificate_key       /etc/nginx/server.key;
    ssl on;
    ssl_session_cache  builtin:1000  shared:SSL:10m;
    ssl_protocols  TLSv1 TLSv1.1 TLSv1.2;
    ssl_ciphers HIGH:!aNULL:!eNULL:!EXPORT:!CAMELLIA:!DES:!MD5:!PSK:!RC4;
    ssl_prefer_server_ciphers on;
    location / {
        rewrite (/ajenti)$ / break;
        rewrite /ajenti/(.*) /$1 break;
        proxy_pass http://127.0.0.1:8000/;
        proxy_set_header Host $host;
        proxy_redirect http://127.0.0.1:8000/ https://{cp.domain.com}/ajenti/;
    }
}
BTW, It's not related to Ajenti it all and most likely I got a newbie mistake in nginx conf file. Just looking for someone how able to point me on that.
Make a duplicate of my question - http://support.ajenti.org/topic/577324-/
This config only for HTTP but it's not working with SSL enabled option. Could someone point me on the correct config for https?