Skip to content

Hosting panel on your own domain

In this article

The control panel can be hosted on your server instead of being called from the HOSTKEY domain.

Note

Customize the panel layout to your liking by editing its HTML file.

Easy placement of the Panel file on your domain

  1. Download the panel code and place it on your server:

    curl -L -o controlpanel.html https://invapi.hostkey.com/controlpanel.html
    

    Note

    The latest version of the control panel can be downloaded from the GitHub repository.

  2. Set the API path using one of the following methods:

    • Call the panel using the predefined API path passed through the base variable
    https://<path_to_the_panel_on_your_domain>/controlpanel.html?base=panel.hostkey.com&key=api-key
    

    or

    • Replace the variable g_base_url in the file controlpanel.html with
    var g_base_url='panel.hostkey.com';
    

Proxy access through nginx

To hide HOSTKEY server information from the user while the control panel is running, position the panel as follows:

  1. Download the panel code and place it on your server:

    mkdir /opt/panel
    cd /opt/panel
    curl -L -o controlpanel.html https://invapi.hostkey.com/controlpanel.html
    

    Note

    The latest version of the control panel can be downloaded from the GitHub repository.

  2. Create a configuration file named hostkeycp.conf in the /etc/nginx/conf.d directory. The file should contain the following information, replacing <your-domain> with the name of the domain bound to your server:

    server {
            listen  80;
            server_name <your-domain>;
    
            access_log  /var/log/nginx/panel_access.log;
            error_log   /var/log/nginx/panel_error.log;
    
            root /opt/panel/;
            index controlpanel.html;
    
            location ~ ^/.+\.php$ {
            proxy_set_header Host panel.hostkey.com;
            proxy_pass https://panel.hostkey.com/$request_uri;
            }
    }
    
  3. Add a line to the http section of the /etc/nginx/nginx.conf file:

    resolver 8.8.8.8;
    
  4. If the /etc/nginx/nginx.conf file is missing the include /etc/nginx/conf.d/*.conf; line, add a line to the http section:

    include /etc/nginx/conf.d/hostkeycp.conf;
    
  5. Verify that the configuration is accurate and reload the nginx configuration:

    nginx -t
    nginx -s reload
    

After configuring these settings, accessing the URL https://<your-domain>/controlpanel.html?key=<API server key> will open the control panel for the specified server