Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7405373
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T05:23:41+00:00 2026-05-29T05:23:41+00:00

I would like to ask how HAProxy can help in routing requests depending on

  • 0

I would like to ask how HAProxy can help in routing requests depending on parts of the URL.

To give you an overview of my setup, I have the HAProxy machine and the two backends:

  • IIS website (main site)
  • WordPress blog on NGINX (a subsite)

The use-case:

I’m expecting to route requests depending on the URL:

  • http://www.website.com/lang/index.aspx -> main site
  • http://www.website.com/lang/blog/articlexx -> blog subsite

The blog access URL is “/server/blog/lang/articlexx” so I have to rewrite the original client request to that format–which is basically switching “blog” and “lang”.

From how I understood the configuration documentation and some posts on the net, I could use reqrep/reqirep to change the request HTTP headers before it gets passed to a backend. And if that’s right, then this configuration should work:

frontend vFrontLiner
    bind            x.x.x.x:x
    mode            http
    option          httpclose
    default_backend iis_website

    # the switch: x/lang/blog -? x/blog/lang
    reqirep ^/(.*)/(blog)/(.*) /if\2/\1/\3

    acl blog path_beg -i /lang/blog/

    use_backend blog_website if blog


backend blog_website
    mode    http
    option  httpclose
    cookie  xxblogxx insert indirect nocache
    server  BLOG1 x.x.x.x:80 cookie s1 check inter 5s rise 2 fall 3
    server  BLOG2 x.x.x.x:80 cookie s2 check inter 5s rise 2 fall 3 backup

The problem: The requests being received by the blog_website backend is still the original URL “x/lang/blog”.

I might have missed something on the regex part but my main concern is whether my understanding correct or not to use the reqirep in the first place. I would appreciate any help.

Thanks very much.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T05:23:42+00:00Added an answer on May 29, 2026 at 5:23 am

    Your regex is wrong, you’re assuming the server is in the request path. To match the request paths in the headers use a regex like this one:

    reqrep ^([^\ ]*)\ /lang/blog/(.*) \1\ /blog/lang/\2
    

    you can use reqirep as well but that is only useful if your servers actually serve /BLog/lAnG/ as well.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to ask you for help with the following code I have
I would like to ask for help on how to achieve this. I have
I would like to ask for a reccomended solution for this: We have a
I would like to ask if I have a table of events on my
I would like to ask about Memory Overhead in java, I have a large
I would like to ask a help about Zensor which is a plugin that
I would like to ask if anybody can find what is the mistake in
I would like to ask about php's preg_match_all. suppose we have the sample string
I would like to ask something about query using mysql I have this table
I would like to ask for help with this, I wanted to check for

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.