How to tell AWS application load balancer to not forward the path pattern?

后端 未结 1 565
时光取名叫无心
时光取名叫无心 2021-02-18 21:16

I have configured my AWS application load balancer to have the following rules:

  • /images/* forward to server A (https://servera.com)
1条回答
  •  攒了一身酷
    2021-02-18 21:35

    Is there a way I can tell the application load balancer to not forward the path patterns?

    No, there isn't. It's using the pattern to match the request, but it doesn't modify the request.

    I don't want to modify my request parameters or change my server side code for this.

    You'll have to change something.

    You shouldn't have to change your actual code. If you really need this behavior, you should be able to accomplish it using the web server configuration -- an internal path rewrite before the request is handed off to the application by the web server should be a relatively trivial reconfigurarion in Nginx, Apache, HAProxy, or whatever is actually listening on the instances.

    Also, it seems to me that you are making things difficult on yourself by wanting the server to respond to a path different than what is requested by the browser. Such a configuration will tend to make it more difficult to ensure correct test results and correct handling of relative and absolute paths, since the applications will have an inaccurate internal representation of what the browser is requesting or will need to request.

    0 讨论(0)
提交回复
热议问题