I'm trying to load balance API Manager 1.9.0 with a front-end NGINX 1.6.2 load balancer. I have 2 servers:
Server A (xxx.xxx.xxx.xx1 and xxx.xxx.xxx.x11) - Public and Private IPs Server B (xxx.xxx.xxx.xx2 and xxx.xxx.xxx.x22) - Public and Private IPs
API Manager 1.9.0 and all four components are installed and started on server B.
I stalled NGINX on Server A which also has API Manager 1.9.0 installed and running in worker mode only. The NGINX software installed in /opt/rh/nginx16/root/etc/nginx. I added the following configuration files to /opt/rh/nginx16/root/etc/nginx/conf.d and successfully started the service:
(am.http.conf)
upstream xxx.xxx.xxx.x11
server xxx.xxx.xxx.x11:9763
server xxx.xxx.xxx.x22:9763
server
listen 80
server_name xxx.xxx.xxx.x11
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 http://xxx.xxx.xxx.x11
(am.https.conf)
upstream xxx.xxx.xxx.1
server xxx.xxx.xxx.xx1:9443
server xxx.xxx.xxx.xx2:9443
server
listen 443
server_name xxx.xxx.xxx.xx1
ssl on
ssl_certificate /opt/rh/nginx16/root/etc/nginx/ssl/wrk.crt
ssl_certificate_key /opt/rh/nginx16/root/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://xxx.xxx.xxx.xx1
(mgt.am.https.conf)
server listen 443 server_name xxx.xxx.xxx.xx2 ssl on ssl_certificate /opt/rh/nginx16/root/etc/nginx/ssl/mgt.crt ssl_certificate_key /opt/rh/nginx16/root/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.xx2:9443/
error_log /var/log/nginx/mgt-error.log
access_log /var/log/nginx/mgt-access.log
I made the documented changes to the axis2.xml, carbon.xml, catalina.server.xml per this document: https://docs.wso2.com/display/CLUSTER420/Clustering+the+Gateway
I'm trying to create a prototype with limited resources.
- Is it ok to an IP address for the upstream server?
- How do I test the configurations above?
- How do I access the index.html page verify that NGINX is installed correctly?
- How do I ensure that the API workers are in sync and talking to the same database?
Any help with this will be greatly appreciated!