# Proxy pass ajax problem

**URL:** <https://www.ruby-forum.com/t/proxy-pass-ajax-problem/226413>\
**Category:** NGINX\
**Created:** [November 16, 2012, 4:21am UTC](https://www.ruby-forum.com/t/proxy-pass-ajax-problem/226413 "2012-11-16T04:21:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![lili](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/b38774/32.png) [@lili](https://www.ruby-forum.com/u/lili)\
**Post date:** [November 16, 2012, 4:21am UTC](https://www.ruby-forum.com/t/proxy-pass-ajax-problem/226413/1 "2012-11-16T04:21:44Z")

</div>

* * *

nginx mailing list  
removed\_email\_address@domain.invalid  
[http://mailman.nginx.org/mailman/listinfo/nginx](http://mailman.nginx.org/mailman/listinfo/nginx)

---

<div class="post-metadata">

**Author:** ![lili](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/b38774/32.png) [@lili](https://www.ruby-forum.com/u/lili)\
**Post date:** [November 16, 2012, 9:23am UTC](https://www.ruby-forum.com/t/proxy-pass-ajax-problem/226413/2 "2012-11-16T09:23:10Z")

</div>

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

> **[Jonathan Matthews :: Words Typed, Great Rates For Cash](https://www.jpluscplusm.com)**

---

<div class="post-metadata">

**Author:** ![lili](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/b38774/32.png) [@lili](https://www.ruby-forum.com/u/lili)\
**Post date:** [November 16, 2012, 9:37am UTC](https://www.ruby-forum.com/t/proxy-pass-ajax-problem/226413/3 "2012-11-16T09:37:12Z")

</div>

> 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](http://domain:7474/ajax-path) just /ajax-path

2. nginx can override location headers by using proxy\_redirect (  
[Module ngx\_http\_proxy\_module](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 (  
[GitHub - nginxinc/nginx-wiki: ARCHIVED -- Source for the now archived NGINX Wiki section of https://www.nginx.com · GitHub](http://wiki.nginx.org/HttpSubModule) )  
in the proxy\_pass location with something like:

sub\_filter [http://domain:7474](http://domain:7474) [http://domain:8000](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
