HAProxy: Backend with subdirectory / subpath / subfolder?

后端 未结 1 1456
花落未央
花落未央 2020-12-29 14:28

I am trying to achieve this:

http://front-end       --> http://back-end/app-1
http://front-end/app-2 --> http://back-end/app-2-another-path


        
相关标签:
1条回答
  • 2020-12-29 14:49

    You can achieve this "http://front-end/app-2/do-that --> http://back-end/app-2-another-path/do-that" with the following configuration:

    frontend http   
       #match url ending with /xxxxx/do-that
       acl do-that path_end -i /app-2/do-that
    
       use_backend server1 if do-that
    
    backend server1
       reqirep ^([^\ :]*)\ /app-2/(.*)     \1\ /app-2-another-path/\2
       server server 168.192.X.X
    

    Here is more information on reqirep.

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