Proxy pass ajax problem


nginx mailing list
[email protected]
http://mailman.nginx.org/mailman/listinfo/nginx

Why don’t you show us how far you’ve got, what problems you ran into,
and what problems you’re still having?

Jonathan

Jonathan M. // Oxford, London, UK
http://www.jpluscplusm.com/contact.html

Thanks.
The problem most likely is that the neo4j server is using it’s own
servername/port for the url creation in the html.

Depending on the situation there are few ways you could fix/work arround
it:

  1. Change the neo4j/application source to use relative paths eg instead
    of
    http://domain:7474/ajax-path just /ajax-path

  2. nginx can override location headers by using proxy_redirect (
    http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_redirect
    )

  3. If you are unable to change the generated output from the neo4j
    backend
    you could try to use the Sub module (
    http://wiki.nginx.org/HttpSubModule )
    in the proxy_pass location with something like:

sub_filter http://domain:7474 http://domain:8000;

… and let nginx alter the source on the fly (though this isnt the best
solution from performance aspect / also there are some caveats if the
response from backend is compressed etc).

rr