Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


Info
titleNote

HostBill Enterprise installed after 2018-03-19 already have ssl configuration stored in  /etc/nginx/ssl.conf 
If you are using such version, you should only edit this file and provide your certificate files locations there.

To install valid SSL Certificate on VPS/Server where HostBill Enterprise is installed:

...

2. Edit file:

Code Block
languagetext
/usr/local/kbkp-software/apps/b-nginx/usr/local/conf/port-80/etc/nginx/conf.d/main.conf


Code Block
languagetext
# vinano /usr/local/kbkp-software/apps/b-nginx/usr/local/conf/port-80/etc/nginx/conf.d/main.conf

...

  • Change server_name to domain name that you have issued the certificate for.

- Save changes

...

  • Change "listen 80;" to "listen 443;"
  • Add line "ssl on;"
  • Provide path to your certificate and private key files like:
    ssl    on;
    ssl_certificate    /etc/ssl/your_domain_name.pem; 
    (or bundle.crt)
    ssl_certificate_key    /etc/ssl/your_domain_name.key;
  • At the very top of mentioned file add following section:

    Code Block
    languagetext

...

/etc/nginx/ssl/bytecp_client.crt

With crt file you've received from your SSL issuer.

...

  • server {
    	listen 80 default_server;
    	listen [::]:80 default_server;
    	server_name _;
    	return 301 https://$host$request_uri;
    }


  •  Save changes

3. Edit file: /etc/nginx/locations/hostbill.conf

Code Block
languagetext
# nano /etc/nginx/ssl/bytecp_client.key

...

locations/hostbill.conf

Below the line "fastcgi_pass   127.0.0.1:9000;" paste:

fastcgi_param HTTPS 'on';


4. Optionally, redirect all traffic from port 80 to 443.
To do that, add following lines at the top of /etc/nginx/conf.d/main.conf

Code Block
languagetext
server {
	listen 80 default_server;
	listen [::]:80 default_server;
	server_name _;
	return 301 https://$host$request_uri;
}


5. Restart webserver & php-fpm:

Code Block
languagetext
/usr/local/kbkp-software/apps/b-nginx/etc/init.d/nginxservice nginx restart && service php-fpm restart