Welcome! Log In Create A New Profile

Advanced

How to solid three urls into one url for its users

David Woodstuck
July 17, 2017 12:08AM
I just use Nginx for a couple of weeks. I have the following questions. I
hope I can get your help.

I have a big web application whose urls are dev01.mydomain.com,
dev02.mydomain and dev03.mydomain.com. I like to use Nginx to deliver this
application for its users. On each page, there are a lot of iframes whose
src can be one of dev01.mydomain.com, dev02.mydomain and dev03.mydomain.com.
I like to use following conf to achieve one url for its users:

server {
listen 80;
server_name localhost;

#charset koi8-r;
#access_log /var/log/nginx/log/host.access.log main;

location / {
root /usr/share/nginx/html;
index index.html index.htm;

proxy_pass http://dev01.mydomain.com/;
subs_filter 'http://dev02.mydomain.com/(.*)' '
http://dev01.mydomain.com/?http://dev02.mydomain.com/$1';
subs_filter 'http://dev03.mydomain.com/(.*)' '
http://dev01.mydomain.com/?http://dev03.mydomain.com/$1';
}
}

My requirements are:
(1). Request with url - http://www.mydomain.com/?http://... will proxy to
http://dev02.mydomain.com/ or http://dev03.mydomain.com/ depending on a
value after ?
(2). Other request will proxy to http://dev01.mydomain.com/.

How do I achieve these requirements?

Thanks,
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

How to solid three urls into one url for its users

David Woodstuck July 17, 2017 12:08AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 226
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