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

梦想与她 提交于 2019-12-03 22:55:49

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!