This documentation is for older WSO2 products. View documentation for the latest release.
Page Comparison - Clustering the Gateway (v.15 vs v.16) - Clustering Guide 4.2.0 - WSO2 Documentation

Versions Compared

Key

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

...

  1. Install Nginx using the following command.
    $sudo apt-get install nginx
  2. Configure Nginx Plus to direct the HTTP requests to the worker nodes with load balancing as two worker nodes via the HTTP 80 port using the http://am.wso2.com/<service> via HTTP 80 portLocate the http{} block of To do this, create a VHost file (am.http.conf) in the /etc/nginx/nginx.conf file conf.d/ directory and add the following configurations into it.

    Code Block
    upstream wso2.am.com {
    	        sticky cookie JSESSIONID;
            server xxx.xxx.xxx.xx3xx4:9763;
    	        server xxx.xxx.xxx.xx4xx5:9763;
    	}
    
    server {
    	        listen 80;
    	        server_name am.wso2.com;
    	        location / {
    		proxy_               proxy_set_header X-Forwarded-Host $host;
                   proxy_set_header X-Forwarded-Server $host;
                   proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                   proxy_set_header Host $http_host;
                   proxy_read_timeout 5m;
                   proxy_send_timeout 5m;
                   proxy_pass http://wso2.asam.com;
    		        }
    	}
  3. Configure Nginx Plus to direct the HTTPS requests to the worker nodes with load balancing as two worker nodes via the HTTPS 443 port using https://am.wso2.com/<service> via HTTPS 443 port. Locate the http{} block of . To do this, create a VHost file (am.https.conf) in the /etc/nginx/nginx.conf file conf.d/ directory and add the following configurations into it.

    Code Block
    upstream ssl.wso2.am.com {
    	sticky cookie JSESSIONID;
    	server xxx.xxx.xxx.xx3xx4:9443;
    	server xxx.xxx.xxx.xx4xx5:9443;
    	}
    
    server {
    	listen 443;
    	server_name am.wso2.com;
    	ssl on;
    	ssl_certificate /etc/nginx/ssl/wrk.crt;
    	ssl_certificate_key /etc/nginx/ssl/wrk.key;
    	location / {
    		               proxy_set_header X-Forwarded-Host $host;
                   proxy_set_header X-Forwarded-Server $host;
                   proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                   proxy_set_header Host $http_host;
                   proxy_read_timeout 5m;
                   proxy_send_timeout 5m;
    	    proxy_pass https://ssl.wso2.am.com;
        		}
    	}
  4. Configure Nginx Plus to access the management console Management Console as https://mgt.am.wso2.com/carbon via HTTPS 443 port. Use the following steps to accomplish this. Locate the http{} block of This is to direct requests to the manager node. To do this, create a VHost file (mgt.am.https.conf) in the /etc/nginx/nginx.conf file conf.d/ directory and add the following configurations into it.

    Code Block
    server {
    	listen 443;
    	server_name mgt.am.wso2.com;
    	ssl on;
    	ssl_certificate /etc/nginx/ssl/mgt.crt;
    	ssl_certificate_key /etc/nginx/ssl/mgt.key;
    
    	location /carbon {
    		 {
                   proxy_set_header X-Forwarded-Host $host;
                   proxy_set_header X-Forwarded-Server $host;
                   proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                   proxy_set_header Host $http_host;
                   proxy_read_timeout 5m;
                   proxy_send_timeout 5m;
    	    proxy_pass https://xxx.xxx.xxx.xx2xx3:9443/;
        		}
    	error_log  /var/log/nginx/mgt-error.log ;
               access_log  /var/log/nginx/mgt-access.log;
    }
  5. Restart the Nginx Plus server.

    $sudo /etc/init.d/nginx restart

    $sudo service nginx restart

    Tip

    Tip: You do not need to restart the server if you are simply making a modification to the VHost file. The following command should be sufficient in such cases.

    $sudo service nginx reload 

Create SSL certificates

Create SSL certificates for both the manager and worker nodes using the instructions that follow.

...