Reverse proxy question

Discussion in 'Install/Configuration' started by Colin360, Mar 21, 2014.

  1. Colin360

    Colin360 New Member


    Trying the enterprise 2cpu atm. Trying to replicate a nginx/apache combo which utilises some reverse proxying of folders to multiple app servers.

    So goes to another php shop vm server. .com/news to a rails app, you get the idea.

    Each of these 'proxied' apps run thinking they are the root i.e. they work on /.

    Nginx can reverse proxy these fine and I believe litespeed can too. I've set up the proxy as webserver in external app etc and it does indeed proxy, but retains the folder/uri.

    The nginx snippet is:

    upstream nginx_shop_srv {
      server fail_timeout=0;
      server fail_timeout=0 backup;
    location ^~ /shop {
            proxy_pass http://nginx_shop_srv/;
    The key being the additional slash on the proxy pass, which replaces the uri with the proxy loc.

    So to restate/clarify, I'm looking for to be seen on the target proxied app server as a request for from litespeed.

    I've tried a few combinations of trailing slash and re-read proxy docs. Nothing lept out, what did I miss?

    Thanks for reading.
  2. NiteWave

    NiteWave Administrator

    try rewriterule

    assume it's native vhost. vhost->Rewrite
    ReriteRule /shop/(.*)$ http://nginx_shop_srv/$1 [P]

    define an external app nginx_shop_srv as web server,
  3. Colin360

    Colin360 New Member

    Rewrite, I never thought to go that way, ok super thank you.

    Going to have to give some time back to learning mod_rewrite I suspect :)

    I modified it slightly to permit /shop working.
    RewriteRule /shop(.*)$ http://nginx_shop_srv/$1 [P]

Share This Page