...
Localtabgroup |
---|
Localtab |
---|
active | true |
---|
id | Single-node |
---|
title | Single node deployment |
---|
| Info |
---|
- The placeholder
{node-ip-address} corresponds to the IP address of the backend node in which the WSO2 API-M server is running. - In the sample configuration given below, the hostname
api.am.wso2.com is used to access all portals (publisher, store, admin, and carbon) and gw.am.wso2.com is used to invoke APIs. Only HTTPS is allowed.
|
Code Block |
---|
upstream sslapi.am.wso2.com {
server {node-ip-address}:9443;
}
upstream sslgw.am.wso2.com {
server {node-ip-address}:8243;
}
server {
listen 80;
server_name api.am.wso2.com;
rewrite ^/(.*) https://api.am.wso2.com/$1 permanent;
}
server {
listen 443;
server_name api.am.wso2.com;
proxy_set_header X-Forwarded-Port 443;
ssl on;
ssl_certificate /etc/nginx/ssl/{cert_name};
ssl_certificate_key /etc/nginx/ssl/{key_name};
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://sslapi.am.wso2.com;
}
access_log /etc/nginx/log/am/https/access.log;
error_log /etc/nginx/log/am/https/error.log;
}
server {
listen 443;
server_name gw.am.wso2.com;
proxy_set_header X-Forwarded-Port 443;
ssl on;
ssl_certificate /etc/nginx/ssl/{cert_name};
ssl_certificate_key /etc/nginx/ssl/{key_name};
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://sslgw.am.wso2.com;
}
access_log /etc/nginx/log/gw/https/access.log;
error_log /etc/nginx/log/gw/https/error.log;
} |
|
Localtab |
---|
id | Active-Active-Deployment |
---|
title | Active-Active Deployment |
---|
| Info |
---|
- The placeholders
{node-1-ip-address} and {node-2-ip-address} correspond to the IP addresses of the backend nodes in which APIM servers are running. - In the sample configuration given below, the hostname
api.am.wso2.com is used to access all portals (publisher, store, admin and carbon) and gw.am.wso2.com is used to invoke APIs. Only HTTPS is allowed. - This configuration uses a session cookie to configure stickiness. However, if you are using Nginx community version, configuring stickiness sticky sessions based on session cookie is not supported. It is possible to use
ip_hash method instead.
|
Note |
---|
In a Active-Active setup, It is mandatory to set up Sticky Sesions (Session Affinitysticky sesions (session affinity) in the load balancers that front the Publisher and Store, and it is optional in the load balancer (if any) that fronts Key Manager or Gateway. However, authentication via session ID fails when Sticky Sesions sticky sesions are disabled in the load balancers of Publisher and store. |
Code Block |
---|
upstream sslapi.am.wso2.com {
server {node-1-ip-address}:9443;
server {node-2-ip-address}:9443;
#ip_hash;
sticky learn create=$upstream_cookie_jsessionid
lookup=$cookie_jsessionid
zone=client_sessions:1m;
}
upstream sslgw.am.wso2.com {
server {node-1-ip-address}:8243;
server {node-2-ip-address}:8243;
}
server {
listen 80;
server_name api.am.wso2.com;
rewrite ^/(.*) https://api.am.wso2.com/$1 permanent;
}
server {
listen 443;
server_name api.am.wso2.com;
proxy_set_header X-Forwarded-Port 443;
ssl on;
ssl_certificate /etc/nginx/ssl/{cert_name};
ssl_certificate_key /etc/nginx/ssl/{key_name};
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://sslapi.am.wso2.com;
}
access_log /etc/nginx/log/am/https/access.log;
error_log /etc/nginx/log/am/https/error.log;
}
server {
listen 443;
server_name gw.am.wso2.com;
proxy_set_header X-Forwarded-Port 443;
ssl on;
ssl_certificate /etc/nginx/ssl/{cert_name};
ssl_certificate_key /etc/nginx/ssl/{key_name};
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://sslgw.am.wso2.com;
}
access_log /etc/nginx/log/gw/https/access.log;
error_log /etc/nginx/log/gw/https/error.log;
} |
|
Localtab |
---|
id | HA-Gateway |
---|
title | HA for Gateway |
---|
| Info |
---|
- The placeholder
{gwm-ip-address} corresponds to the IP addresses of the backend nodes in which Gateway Manager server is running. Similarly, {gw-1-ip-address} and {gw-2-ip-address} are the nodes in which Gateway Workers are running. - In the sample configuration given below, the hostname
mgtgw.am.wso2.com is used to access management console of of the Gateway Manager and gw.am.wso2.com is is used to invoke APIs. Only HTTPS is allowed.
|
Code Block |
---|
upstream mgtgw.am.wso2.com {
server {gwm-ip-address}:9443;
}
upstream sslgw.am.wso2.com {
server {gw-1-ip-address}:8243;
server {gw-2-ip-address}:8243;
}
server {
listen 80;
server_name mgtgw.am.wso2.com;
rewrite ^/(.*) https://mgtgw.am.wso2.com/$1 permanent;
}
server {
listen 443;
server_name mgtgw.am.wso2.com;
proxy_set_header X-Forwarded-Port 443;
ssl on;
ssl_certificate /etc/nginx/ssl/{cert_name};
ssl_certificate_key /etc/nginx/ssl/{key_name};
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://mgtgw.am.wso2.com;
}
access_log /etc/nginx/log/gwm/https/access.log;
error_log /etc/nginx/log/gwm/https/error.log;
}
server {
listen 443;
server_name gw.am.wso2.com;
proxy_set_header X-Forwarded-Port 443;
ssl on;
ssl_certificate /etc/nginx/ssl/{cert_name};
ssl_certificate_key /etc/nginx/ssl/{key_name};
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://sslgw.am.wso2.com;
}
access_log /etc/nginx/log/gw/https/access.log;
error_log /etc/nginx/log/gw/https/error.log;
} |
|
Localtab |
---|
id | HA-Publisher |
---|
title | HA for Publisher |
---|
| Info |
---|
- The placeholders
{publisher-1-ip-address} and {publisher-2-ip-address} correspond to the IP addresses of the backend nodes in which APIM Publishers are running. - In the sample configuration given below, the hostname
publisher.am.wso2.com is used to access publisher portal. Only HTTPS is allowed. - This configuration uses a session cookie to configure stickiness. However, if you are using Nginx community version, configuring stickiness sticky sessions based on session cookie is not supported. Its It is possible to use the
ip_hash method instead.
|
Code Block |
---|
upstream publisher.am.wso2.com {
server {publisher-1-ip-address}:9443;
server {publisher-2-ip-address}:9443;
#ip_hash;
sticky learn create=$upstream_cookie_jsessionid
lookup=$cookie_jsessionid
zone=client_sessions:1m;
}
server {
listen 80;
server_name publisher.am.wso2.com;
rewrite ^/(.*) https://publisher.am.wso2.com/$1 permanent;
}
server {
listen 443;
server_name publisher.am.wso2.com;
proxy_set_header X-Forwarded-Port 443;
ssl on;
ssl_certificate /etc/nginx/ssl/{cert_name};
ssl_certificate_key /etc/nginx/ssl/{key_name};
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://publisher.am.wso2.com;
}
access_log /etc/nginx/log/publisher/https/access.log;
error_log /etc/nginx/log/publisher/https/error.log;
}
|
|
Localtab |
---|
id | HA-Store |
---|
title | HA for Store |
---|
| Info |
---|
- The placeholders
{store-1-ip-address} and {store-2-ip-address} correspond to the IP addresses of the backend nodes in which APIM Stores are running. - In the sample configuration given below, the hostname store.am.wso2.com is used to access Publisher portal. Only HTTPS is allowed.
- This configuration uses a session cookie to configure stickiness. However, if you are using Nginx community version, configuring stickiness sticky sessions based on session cookie is not supported. Its It is possible to use
ip_hash method instead.
|
Code Block |
---|
upstream store.am.wso2.com {
server {store-1-ip-address}:9443;
server {store-2-ip-address}:9443;
#ip_hash;
sticky learn create=$upstream_cookie_jsessionid
lookup=$cookie_jsessionid
zone=client_sessions:1m;
}
server {
listen 80;
server_name store.am.wso2.com;
rewrite ^/(.*) https://store.am.wso2.com/$1 permanent;
}
server {
listen 443;
server_name store.am.wso2.com;
proxy_set_header X-Forwarded-Port 443;
ssl on;
ssl_certificate /etc/nginx/ssl/{cert_name};
ssl_certificate_key /etc/nginx/ssl/{key_name};
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://publisher.am.wso2.com;
}
access_log /etc/nginx/log/store/https/access.log;
error_log /etc/nginx/logs/store/https/error.log;
}
|
|
Localtab |
---|
id | HA-Key-Manager |
---|
title | HA for Key Manager |
---|
| Info |
---|
- The placeholders
{km-1-ip-address} and {km-2-ip-address} correspond to the IP addresses of the backend nodes in which APIM Key Managers are running. - In the sample configuration given below, the hostname
km.am.wso2.com is used to access Key Manager. Only HTTPS is allowed. - This configuration uses a session cookie to configure stickiness. However, if you are using Nginx community version, configuring stickiness sticky sessions based on session cookie is not supported. Its It is possible to use
ip_hash method instead.
|
Code Block |
---|
upstream km.am.wso2.com {
server {km-1-ip-address}:9443;
server {km-2-ip-address}:9443;
#ip_hash;
sticky learn create=$upstream_cookie_jsessionid
lookup=$cookie_jsessionid
zone=client_sessions:1m;
}
server {
listen 80;
server_name km.am.wso2.com;
rewrite ^/(.*) https://km.am.wso2.com/$1 permanent;
}
server {
listen 443;
server_name km.am.wso2.com;
proxy_set_header X-Forwarded-Port 443;
ssl on;
ssl_certificate /etc/nginx/ssl/{cert_name};
ssl_certificate_key /etc/nginx/ssl/{key_name};
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://km.am.wso2.com;
}
access_log /etc/nginx/log/km/https/access.log;
error_log /etc/nginx/log/km/https/error.log;
}
|
|
|
...
Warning |
---|
- This step is only relevant to the Store and Publisher nodes when fronting multiple nodes with a Load Balancerload balancer.
- These configurations need to be added in all the Publisher and Store nodes.
|
When using a Load Balancerload balancer, you need to configure Reverse Proxy for the API Store URL, API Publisher URL, Admin Portal URL, and whatever other URLs that you are working with for the portals to be able to work with the Proxy Server configuration.
...