How To: Automatically Redirect the Server Hostname to NodeWorx

By default, navigating to https://{hostname.com}/nodeworx in the browser (replacing {hostname.com} with the corresponding information) will automatically redirect to https://{hostname.com}:2443/nodeworx .

It is also possible to use the template system to automatically redirect https://{hostname.com} directly to https://{hostname.com}:2443/nodeworx, if desired.

Setting Up the Redirect

  1. Log in to the server at the CLI as root, either via SSH or from the terminal

  2. At the CLI, run the following–this will automatically open the template file in a text editor:

    ~iworx/bin/config.pex --customize-template http/iworx-proxy --for-global
    
  3. Above the section titled # Reverse proxy section, webmail only for now. (Allows self-signed and expired SSLs), add the following lines, replacing hostname.com with the corresponding information and format for the server’s hostname:

    {literal}
     ##
     # Redirect hostname.com to https://hostname.com:2443/nodeworx
     ##
     RewriteCond %{HTTP_HOST} ^hostname\.com$
     RewriteRule ^/?$ https://%{HTTP_HOST}:2443/nodeworx [R,L]
     {/literal}
    
  4. Save the file and exit the text editor

  5. Run the following to rewrite /etc/httpd/conf.d/iworx-proxy.conf, and apply the template changes:

    ~iworx/bin/httpd.pex --write-proxy-vhost
    
  6. Restart or reload Apache

    systemctl restart httpd
    

    or

    systemctl reload httpd