Quantcast
Channel: HAProxy community - Latest topics
Viewing all articles
Browse latest Browse all 4849

Backend by dns and not by ip

$
0
0

@slemesp wrote:

Hello,

I have 2 servers: server_1 and server_2 where server_2 is a virtual machine that to access it I have to access by sub.domain.com because if I use the ip I will be accessing the main machine.

I have configured that server_1 uses the ip and server_2 use the option redir.

server server_1 10.0.0.1:80 check
server server_2 10.0.0.1:80 check redir http://sub.domain.com

Now I have a problem, when using server_2 my application gives problems with Access-Control-Allow-Origin. From what I’ve added in the frontend
http-response add-header Access-Control-Allow-Origin% [capture.req.hdr (0)] if {capture.req.hdr (0) -m found}

But when you add that line, it gives problems to my server_1, since Access-Control-Allow-Origin is duplicated

How can I configure that when accessing server_1, do not add Access-Control-Allow-Origin and when you access server_2, add it?

Or how can I do to not use the redirect option and when using server_2 use the domain name and not its ip?

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 4849

Trending Articles