Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a server using nginx as a reverse proxy which is passing requests for to the port 80 forwarding is working perfectly fine but I also need to forward port 9292 for a javascript messaging service.

My server{} entry for the 9292 server is:

    listen 9292;
    location / {
            add_header Access-Control-Allow-Origin;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header Host $http_host;
            proxy_redirect off;

But when I go to the application my chrome console gets this error:

Unexpected response code: 400 

And then loads of this error:

XMLHttpRequest cannot load Origin is not allowed by Access-Control-Allow-Origin.

It is able to request the initial javascript from the server at but after that I just get this error.

Everything I'm reading implies that this should be working fine so what am I missing?

share|improve this question

After a bit of twaeking I managed to solve the Access-Control-Allow-Origin Issue but the Unexpected Response Code: 400 was because web sockets don't work through reverse proxies yet.


share|improve this answer
Can you explain what you meant by "a bit of tweaking"? – denaje Jul 28 '14 at 19:17
I tweaked our firewall to let faye talk directly the webserver instead of going through the reverse proxy – Arcath Jul 29 '14 at 20:07

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.