0

I am using an implemention of nginx with jetty servlets.

For the purpose of my project I need to initialize two connection to the jetty servlet and keep them open. To initialize the downlink I use a normal request and I get the inputstream back. To initialize the uplink I use a chunked encoding request.

I use a 1.4.6 nginx version so the chunked encoding should be set by default, regardless I set it in my server definition.

 #HTTPS server

server {
    listen 443;
    listen [::]:443;
    server_name  localhost;

    ssl                  on;
    ssl_certificate      /etc/nginx/ssl/server.crt;
    ssl_certificate_key  /etc/nginx/ssl/server.key;

    ssl_session_timeout  5m;

    ssl_protocols  SSLv2 SSLv3 TLSv1;
    ssl_ciphers  HIGH:!aNULL:!MD5;
    ssl_prefer_server_ciphers   on;
    location / {
        proxy_http_version 1.1;
        expires off;
        proxy_buffering off; 
        chunked_transfer_encoding on;
        proxy_pass      https://127.0.0.1:8080;
    #    root   html;
    #    index  index.html index.htm;
    }
}

I've searched through all the forums and I still can't come across a solution. Enabled chunked encoding, proxy buffering off etc etc. I can't get it to work. I have also done simple tests to make that it's not my apps implementation that's blocking it somehow and it still doesn't work.

Anything else I can try?

imps
  • 1,423
  • 16
  • 22
  • Perhaps KeepAlive is what you're looking for? If that does not work, I would research solutions in dealing with websockets and it probably requires you to implement a Connection upgrade. Come to think of it, it's very likely you proxy a Connection: close header. –  Sep 16 '14 at 07:02
  • So I also posted on the nginx forum and I got a reply. The thing I am specifically looking for is called "unbuffered upload" and that is currently a feature that nginx does not provide. Using websockets is out of the question because later this prototype will need to be implement in a bigger and older system that uses the http protocol. So the answer for this would be it's not possible with "nginx". A possible work around for anyone facing the same issue is using tengine which is an nginx fork. – imps Sep 16 '14 at 08:54

1 Answers1

0

So I also posted on the nginx forum and I got a reply. The thing I am specifically looking for is called "unbuffered upload" and that is currently a feature that nginx does not provide.

Using websockets is out of the question because later this prototype will need to be implement in a bigger and older system that uses the http protocol. So the answer for this would be it's not possible with "nginx". A possible work around for anyone facing the same issue is using tengine which is an nginx fork.

imps
  • 1,423
  • 16
  • 22
  • Or just use jetty directly, without nginx in front of it. – Joakim Erdfelt Sep 16 '14 at 19:08
  • I need a reverse proxy for both security reasons and load balancing eventually. So using jetty directly is not an option. The systems needs to reliable and securely handle over 100k connections. If you have any other suggestion I'd be really thankful if you elaborate :) – imps Sep 17 '14 at 08:51