Welcome! Log In Create A New Profile

Advanced

How to create same location to point different proxy server

abdul kadhar
May 23, 2023 03:06AM
Hi,

I need to know how to configure nginx for below scenario.

I have configured the Load Balancer(Nginx) for ignition. I have created two
upstream(ignapp & ignProdapp) server. For ignapp upstream it is working
fine. I need to configure the below code for upstream server(ignProdapp) in
the same configuration file how to do this. Below is the sample
configuration for the server ignapp. Can you please help me how to
configure the below settings for another upstream server. Below is the
config setting for ignapp same way I need to do it for creating location ~
/data/, location ~ /system/ , location ~ /res/ , location ~ /idp/, location
~ /.well-known/ for ignappPro Upstream server .



Upstream ignapp{
ip_hash;
server 10.10.10.11:8088;
}
upstream ignappPro {
ip_hash;
server 10.10.10.12:8088;
}
server {
listen 80;
server_name www.abdul.com;
location ~ /data/ {

proxy_pass ignapp/data/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_pass_request_headers on;
proxy_cache_bypass $http_upgrade;
}

location ~ /system/ {

proxy_pass ​ignapp/system/;
tp_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_pass_request_headers on;
proxy_cache_bypass $http_upgrade;
}

location ~ /res/ {

proxy_pass ignapp/res/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_pass_request_headers on;
proxy_cache_bypass $http_upgrade;
}

location ~ /idp/ {

proxy_pass ​ignapp/idp/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_pass_request_headers on;
proxy_cache_bypass $http_upgrade;
}

location ~ /.well-known/ {

proxy_pass ignapp/.well-known/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_pass_request_headers on;
proxy_cache_bypass $http_upgrade;
}

# Here we are setting the protocol type, address, port, and uri (optional)
that will be the destination of our proxied server:
location / {
proxy_pass ​ignapp/data/perspective/client/demo/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_pass_request_headers on;
proxy_cache_bypass $http_upgrade;
}
}
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
https://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

How to create same location to point different proxy server

abdul kadhar 230 May 23, 2023 03:06AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 103
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready