Nginx Load Balancing SSL Termination (HP Cloud+Ubuntu)

Advertisement

Here is How To Setup Nginx Load Balancing SSL Termination on HP Cloud Running Ubuntu Latest Version. Supported by both Nginx Free Ed. & Plus. For HP Horizon Cloud, we need some special extra steps for the first time as there is router. The commands, definitely will remain the same for any cloud service provider.

Prerequisites of Nginx Load Balancing SSL Termination

Nginx, both community version and the paid Nginx Plus can be configured as a load balancer to distribute load to the backend servers. As SSL termination occurs on the load balancer so SSL/TLS configuration must be done on the server instance we are talking about. We will not discuss about this part in this guide.

Advertisement

---

Nginx Load Balancing SSL Termination (HP Cloud+Ubuntu)

Normally we will proceed to install Nginx :

Vim

1

2

apt-get update-y&&apt-get upgrade

apt get install nginx-full

We do not need to install PHP5/ PHP5-FPM on this instance as the request will be conveyed to the backend servers. Now take that, the subnet mask of the web servers are 10.0.0.10 and 10.0.0.11, on nginx.conf file we should have :

Vim

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

http{

upstreamweb_rack{

server10.0.0.10:80;

server10.0.0.11:80;

#underscores_in_headers on;

}

server{

listen80;

server_name thecustomizewindows.com;

location/{

proxy_pass http://web_servers;

}

}

}

next, the host file should have the /etc/nginx/sites-available/default file like this :

Vim

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

server{

listen80;

listen443ssl spdy default;

server_name thecustomizewindows.com;

ssl on;

....

SSL Specific Settings

....

location/{

proxy_pass http://web_servers;

proxy_set_header Host$host;

proxy_set_headerX-Real-IP$remote_addr;

proxy_set_headerX-Forwarded-For$proxy_add_x_forwarded_for;

proxy_set_headerX-Forwarded-Proto$scheme;

}

}

For one website setup, frankly we can do the works only on /etc/nginx/sites-available/default file. As Nginx Plus uses the nginx.conf, we have shown this kind of setup.