ProxyPass

Discussion in 'Feedback/Feature Requests' started by dlhhyct, Oct 29, 2006.

  1. dlhhyct

    dlhhyct New Member

  2. mistwang

    mistwang LiteSpeed Staff

    Rewrite only works when everything is on the same server, just the URLs/Hosts are different, as the example you gave.

    As to what you want at the beginning of the thread, rewrite does not work. Maybe a reverse proxy to api.search.yahoo.com works, if the request without any change can be processed by yahoo.

    For the forward proxy feature, it is not trivial, we can put it on our to-do list, but I am not sure when it will be implemented.

    So, if the reverse proxy does not work, you need to setup Apache or lighttpd behind LSWS for the proxypass feature, or, you can also try some off shelf cgiproxy scripts written in perl or PHP.

    Good luck. :)
  3. dlhhyct

    dlhhyct New Member

    ok

    I have to find a good clean solution instead of just throwing whole bunch of stuff together. Thanks.
  4. rlance

    rlance New Member

    example, please

    Yes, indeed, I would be grateful to learn how to accomplish the forward and reverse proxy via rewrite. Could you provide an example?
  5. SoreGUms

    SoreGUms New Member

    Resurrecting an old thread is always fun... I need to do something similar to the OP.

    In apache you do this:

    ProxyPass /pytest/ http://192.168.1.8:8086/py/
    ProxyPassReverse /pytest/ http://192.168.1.8:8086/py/

    ProxyPass /pydev/ http://192.168.1.34:8086/py/
    ProxyPassReverse /pydev/ http://192.168.1.34:8086/py/

    This allows me to use the following URLs in my AJAX comms:

    http://mysite.com/pytest/ - goes to the .8:8086/py/ host - in the log file the request is for /py/ not /pytest/
    http://mysite.com/pydev/ - goes to the .34:8086/py/ host - in the log file the request is for /py/ not /pydev/

    How do I do the above in LSWS?

    As it stands in v3.3.15 I see I can add
    TEST = 192.168.1.8:8086
    DEV = 192.168.1.34:8086
    as webservers. Then on the vhost mysite.com I can set a proxy context as
    URI: /pytest/
    Webser: TEST

    but when I do
    http://mysite.com/pytest/
    the result that gets passed through is
    http://192.168.1.8:8086/pytest/
    I need that to be
    http://192.168.1.8:8086/py/

    How do I do what I want in LSWS? At the moment it looks like I don't and I uninstall LSWS and use Apache or something that can... I don't want to do this
    Thanks :)
  6. mistwang

    mistwang LiteSpeed Staff

    With Enterprise edition, you should be able to rewrite the URL from "/pytest/" to "/py/" with rewrite rule, however, LSWS will not do any link rewrite in response body.
  7. Marcus

    Marcus New Member

    NginX can too, and I agree that it would probably be a very useful feature.

    It should be pointed out, though, that if it were to be implemented, that users should make sure not to turn their server into an open proxy unintentionally. Many hosting companies would have problems with this, and it would negatively impact on server performance. This might be something to mention in the documentation, were it to be implemented.
  8. mistwang

    mistwang LiteSpeed Staff

    Nginx proxy module is "an HTTP/1.0 proxy without the ability for keep-alive requests", it is a reverse proxy, not a squid like forward proxy.

    The same function is present in LiteSpeed long time ago, and HTTP/1.1 keep-alive is always used for maximum performance, even when the client request is HTTP/1.0.

Share This Page