Reputation: 595
I am first time working with Nginx.
I have successfully configured tomcat to run on different port. My tomcat is running on following ports.
5.6.7.8:8080
5.6.7.8:8081
5.6.7.8:8082
I have also deployed my war file on tomcat(each of the instance).
I have configured my nginx as follows
created a default.conf in /etc/nginx/conf.d
Made changes to the file according the following link Nginx Configuration
server {
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
# Make site accessible from http://localhost/
server_name 1.2.3.4;
location / {
proxy_pass http://www.example.com;
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ =404;
# Uncomment to enable naxsi on this location
# include /etc/nginx/naxsi.rule
}
location /user/{
proxy_pass http://5.6.7.8:8080$uri;
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ =404;
# Uncomment to enable naxsi on this location
# include /etc/nginx/naxsi.rule
}
}
The name of War file which I deployed on SERVER TWO is Example.
which contains a api /user/login?param1=xyz¶m2=abc¶m3=mno
What all things I have to change in order to get the result when I hit 1.2.3.4/user
Thank you
Upvotes: 1
Views: 1901
Reputation: 595
The only problem was the try_files I commented the try files and every thing is working correctly.
Upvotes: 1