Results 1 to 10 of 10
  1. #1
    Member
    Join Date
    Aug 2009
    Location
    Zagreb
    Posts
    3

    Reverse proxy - Nginx?

    Hi

    I am thinking about using reverse proxy in my app so that part of the site could be server by the web app server and push part by the Lightstreamer.

    Up to now I have been using Nginx as reverse proxy, and I wanted to check if anyone has experience with Nginx+LightStreamer combination?

    Many thanks!

    Davorin

  2. #2
    Administrator
    Join Date
    Jul 2006
    Location
    Milan
    Posts
    1,090
    Do you mean that Nginx would intercept requests directed to Lightstreamer Server,
    then forward them to the Server through a different HTTP connection?

    This would partly limit Lightstreamer capabilities; see this post, or this one, for similar cases.

    If you can instruct Nginx to only route packets to Lightstreamer (in a way similar to a load balancer) this would be ideal.

    I can't answer on the insights of Nginx.

  3. #3
    Member
    Join Date
    Aug 2009
    Location
    Zagreb
    Posts
    3
    Quote Originally Posted by DarioCrivelli
    Do you mean that Nginx would intercept requests directed to Lightstreamer Server,
    then forward them to the Server through a different HTTP connection?

    This would partly limit Lightstreamer capabilities; see this post, or this one, for similar cases.

    If you can instruct Nginx to only route packets to Lightstreamer (in a way similar to a load balancer) this would be ideal.

    I can't answer on the insights of Nginx.
    I was thinking of using Nginx as reverse proxy / load balancer. Nginx would accept all incomming HTTP requests for domain, and based on url it would make http requests towards either app server (www.mydomain.com/app) or Lightstreamer (www.mydomain.com/lightstreamer).

    So in this scenario Nginx would be terminating all client connections, and have open connections towards the app server(s) and Lightstreamer server. Acting as reverse proxy, Nginx is supposed ta scale well and at least accordingly to the data presented should be able to handle large number of parallel connections (it also uses async sockets).

    What capabilities would be limited in this setup? Probably Adaptive streaming? Anything else?

    Many thanks!
    Davorin

  4. #4
    Administrator
    Join Date
    Jul 2006
    Location
    Milan
    Posts
    1,090
    It depends on how your reverse proxy manages persistent connections.
    If it buffers the Server response until the whole content is received,
    so that the response is sent to the client atomically,
    then streaming is not possible at all.
    Note that some client libraries can detect such case and switch to long polling,
    but, if you ascertain that streaming is not possible,
    you should directly configure the clients for long polling.

    Otherwise, the only issues can be related to Adaptive Streaming.
    Lightstreamer Server tries to minimize the number of sent packets
    that are waiting to be read by the client
    and the reverse proxy could interfere, by buffering more packets.
    In case of network congestion, such packets could become obsolete
    and could have been conflated.

  5. #5
    Member
    Join Date
    Nov 2010
    Location
    Mill Valley
    Posts
    1

    Nginx

    I have the same problem - using NGINX as a reverse proxy to LightStreamer (for push), and Tomcat (for static).

    Reason: so that both can use port 80.

    This is critical to my evaluation of the product.

    If both can't run over port 80, then LS is out of the question for us.

  6. #6
    Power Member
    Join Date
    Jul 2006
    Location
    Cesano Maderno, Italy
    Posts
    784
    Hi,

    please can you expand on what problem are you experiencing?

  7. #7
    Administrator
    Join Date
    Jul 2006
    Location
    Milan, Italy
    Posts
    521
    @dmoshal

    I confirm it is very important to run LS on port 80, to prevent firewalls and proxies to block its traffic. But using a reverse proxy for this purpose is usually discouraged, because you are introducing a bottleneck in your system and you are hiding the real state of the connection to LS Server. That said, it works.
    As an alternative, you can easily set up both LS Server and the Web Server on port 80 by using two network cards or by using a couple of virtual machines. Of course, you need to public IP addresses in any case.

    In more typical production scenarios, there is a cluster of servers with a load balancer in front of them. In these cases, it is up to the load balancer to route the requests to the right server and there is number of configurations possible, impacting in different ways on the number of public IP addresses needed. (Clustering is not allowed with Lightstreamer Moderato).

  8. #8
    Quote Originally Posted by Alessandro View Post
    @dmoshal

    I confirm it is very important to run LS on port 80, to prevent firewalls and proxies to block its traffic. But using a reverse proxy for this purpose is usually discouraged, because you are introducing a bottleneck in your system and you are hiding the real state of the connection to LS Server. That said, it works.
    I also tried to configure Nginx as reverse proxy for Lightstreamer, but with no success. If you say it works, how would a working configuration look like? I wonder, why i can not find an example for .e.g. reverse proxy one of the demo applications.

  9. #9
    Administrator
    Join Date
    Jul 2006
    Location
    Milan, Italy
    Posts
    521
    @essagl, Nginx should work with no specific configuration. In the worst case, you will see connections to Lightstreamer in polling mode. Enabling streaming and/or WebSockets will improve performance. But is seems you are having other issues. Can you expand on what problem you are seeing exactly?

  10. #10
    Quote Originally Posted by Alessandro View Post
    @essagl, Nginx should work with no specific configuration. In the worst case, you will see connections to Lightstreamer in polling mode. Enabling streaming and/or WebSockets will improve performance. But is seems you are having other issues. Can you expand on what problem you are seeing exactly?
    Hi Alessandro,
    it was a configuration problem.
    Found a working configuration here: http://nginx.com/blog/websocket-nginx/

 

 

Similar Threads

  1. Tibco proxy pass issue
    By vdhinesh in forum Client SDKs
    Replies: 1
    Last Post: December 7th, 2009, 01:36 PM
  2. New Proxy Data Adapter with recovery
    By Alessandro in forum Adapter SDKs
    Replies: 0
    Last Post: November 14th, 2008, 06:04 PM
  3. Domain name with proxy server
    By ksivasam in forum Client SDKs
    Replies: 4
    Last Post: January 16th, 2008, 08:58 PM
  4. Internet Explorer --> Proxy issue
    By Mone in forum Client SDKs
    Replies: 0
    Last Post: October 22nd, 2007, 11:20 AM
  5. Using the .NET client API behind a proxy
    By DarioCrivelli in forum Client SDKs
    Replies: 0
    Last Post: June 14th, 2007, 05:59 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT +1. The time now is 12:20 AM.