0% found this document useful (0 votes)
105 views

How to Use Nginx with WebSphere Application Server

Uploaded by

ziden wejdi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
105 views

How to Use Nginx with WebSphere Application Server

Uploaded by

ziden wejdi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

22/05/2024 11:46 How to Use Nginx with WebSphere Application Server?

 

Home → Nginx

Advertiser disclosure 

How to Use Nginx with WebSphere Application


Server?
Last updated: August 28, 2023

Geekflare articles are written by humans for humans.

Chandan Kumar
Contributor

IBM WAS (WebSphere Application Server) usually go with IBM HTTP Server, However; then this
quick guide will help you.

IHS is based on Apache HTTP server, and it works, but when it comes to performance, then
nothing beat Nginx web server.

Nginx market share is gradually increasing in top million busiest sites.

https://geekflare.com/nginx-integration-websphere/ 1/8
22/05/2024 11:46 How to Use Nginx with WebSphere Application Server?

 

Let’s see what it takes to integrate Nginx with IBM WAS. The following is demonstrated in
Linux environment.

I assume you have installed WAS & Nginx. If not, here is quick guide to installing Nginx

Login into Web Server

Install using following commands

yum install epel-release


yum install nginx

Few things to note when using Nginx.

You don’t need to use the WebSphere Plug-in. Instead, we will use proxy_pass

You can either forward all request to WebSphere or by context root in location directive

You need to specify all JVM host and port manually in Nginx configuration file

Let’s get it started…

Login to Nginx server

Take a backup of nginx.conf file (/etc/nginx/nginx/conf in default installation location)

Add the following upstream under http block

upstream wasservers {
server localhost:9080;
server localhost:9081;
}

In above example, I am creating an upstream backend called “wasservers” and have


configured two JVM. You can configure as many as you need.
https://geekflare.com/nginx-integration-websphere/ 2/8
22/05/2024 11:46 How to Use Nginx with WebSphere Application Server?

Note: if your WAS server is different than Nginx then you got to ensure necessary ports are
 
allowed in the firewall.

Next, I will instruct Nginx to forward all request to a newly created wasservers backend.

Add the following proxy_pass under location block

proxy_pass http://wasservers;

it should look like this

location /
{
proxy_pass http://wasservers;
proxy_set_header Host $host;
}

Restart the Nginx web server

service nginx restart

Let’s verify by accessing WAS application through Nginx listening address

https://geekflare.com/nginx-integration-websphere/ 3/8
22/05/2024 11:46 How to Use Nginx with WebSphere Application Server?

 

So you can see I got cachemonitor application opened through Nginx.

This is very basic configuration to get IBM WAS integrated with Nginx as front-end web
server.

You may also be interested in exploring additional Nginx configuration like;

Configuring load balancing – you can setup a load balancing to distribute request based on
client IP. This would be useful or necessary if you have multiple JVM’s and want to persist the
connection.

This is possible by adding ip_hash in an upstream module. For ex:

upstream wasservers {
ip_hash;
server localhost:9080;
server localhost:9081;
}

https://geekflare.com/nginx-integration-websphere/ 4/8
22/05/2024 11:46 How to Use Nginx with WebSphere Application Server?

Taking WAS JVM out – if you have configured multiple JVM’s and for some reason one of
 
them are having an issue, then you have two options.

Either you delete the JVM server: port from an upstream module or
leverage down parameter to temporarily disable the request forwarding.

For ex:

upstream wasservers {
ip_hash;
server localhost:9080;
server localhost:9081 down;

If you are looking for advanced configuration like session affinity, health checks, etc., hen you
got to use Nginx Plus.

I hope this short note give you an idea how to implement Nginx as a web server in front of
IBM WAS. You may also refer to IBM official guide for more details.

Chandan Kumar
Contributor 

Chandan Kumar is a founder of Geekflare. He has been instrumental in the development of


valuable content and resources for a global audience of businesses and individuals.

Was this helpful?  

Thanks to our partners

https://geekflare.com/nginx-integration-websphere/ 5/8

You might also like