nginx proxy to comet

comet, nginx

Solution

i don't think, that is possible ...

`localhost:8080/long_polling` is a `URI` ... more exactly, it should be `http://localhost:8080/long_polling` ... in `HTTP` the `URI` would be resolved as requesting `/long_polling`, to port 80 to the server with at the domain 'localhost' ... that is, opening a tcp-connection to 127.0.0.1:80, and sending

GET /long_polling HTTP/1.1
Host: localhost:8080

plus some additional HTTP headers ... i haven't heard yet, that ports can be bound accross processes ...

actually, if i understand well, nginx was designed to be a scalable proxy ... also, they claim they need 2.5 MB for 10000 HTTP idling connections ... so that really shouldn't be a problem ...

what comet server are you using? could you maybe let the comet server proxy a webserver? normal http requests should be handled quickly ...

greetz

back2dos

Problem

I need some help from some linux gurus. I am working on a webapp that includes a comet server. The comet server runs on localhost:8080 and exposes the url localhost:8080/long_polling for clients to connect to. My webapp runs on localhost:80. I've used nginx to proxy requests from nginx to the comet server (localhost:80/long_polling proxied to localhost:8080/long_polling), however, I have two gripes with this solution: - nginx gives me a 504 Gateway time-out after a minute, even though I changed EVERY single time out setting to 600 seconds - I don't really want nginx to have to proxy to the comet server anyway - the nginx proxy is not built for long lasting connections (up to half an hour possibly). I would rather allow the clients to directly connect to the comet server, and let the comet server deal with it. So my question is: is there any linux trick that allows me to expose localhost:8080/long_polling to localhost:80/long_polling without using the nginx proxy? There must be something. That's why I think this question can probably be best answered by a linux guru. The reason I need /long_polling to be exposed on port 80 is so I can use AJAX to connect to it (ajax same-origin-policy). This is my nginx proxy.conf for reference: ``` proxy_redirect off; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; client_max_body_size 10m; client_body_buffer_size 128k; proxy_connect_timeout 600; proxy_send_timeout 600; proxy_read_timeout 600; proxy_buffer_size 4k; proxy_buffers 4 32k; proxy_busy_buffers_size 64k; proxy_temp_file_write_size 64k; send_timeout 600; proxy_buffering off; ```

Original source