I have two machines, and they are served by a master machine. The master machine defines the first machine 10.10.0.59
server {
listen 80;
client_max_body_size 200M;
server_name localhost 127.0.0.1;
server_name_in_redirect off;
location / {
proxy_pass http://10.10.0.59;
proxy_redirect default;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location ^~ /dev/ {
proxy_pass http://10.10.0.56;
proxy_redirect default;
proxy_set_header Host $http_host;
rewrite /dev/(.*) /$1 break;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
The dev
machine is 10.19.9.56
and I need to add (most likely) /dev/
to the url path, so that I can browse it by http://public_domain/dev/.....
Each of these machines has several apps running.
With this new rule, I can go on by http://public_domain/dev/app1/
but all the links on that page will point to, for example, http://public_domain/app1/login
which is server#1.
What else is wrong? Thanks.
Should I setup a new server clause? If I do, do I need to open a different port because the these two location
blocks are inside the same server clause and listening on 80.
Thanks.