2
17 Comments

Best reverse proxy for REST Api used as SaaS

Our SaaS product uses Microservice architecture and frontend connects to the server through REST Api.

We currently use NGINX but currently we find it difficult to manage around 8 virtual hosts. And when ever we need to add a new, setting up ssl and conf are becoming hectic as its all manual (not many possibilities for common code too).

Main problem is NGINX doesn't have a GUI management tool and all needs to be done at terminal/file level.

It would be great if someone suggests a better alternative and products which offer easy configuration through GUI.

We basically need a reverse proxy for

  1. Rate limiting
  2. Map service urls to the request url(upstream)
  3. Monitoring
  4. Little learning curve

Update:
As of now, NGINX Plain + jinja templates sounds awesome!

Thanks

on April 25, 2021
  1. 2

    from your other post it looks like you're running on GCP, you might want to checkout GKE if you're growing as fast as it looks like you're.

    1. 1

      Yes, we are on GCP (Cloud run). We are a very small team (one backend and one frontend) currently + bootstrapped. GKE sounds for medium sized teams, afaik. Please correct me if I'm wrong.

      1. 1

        if you don't know about it, then I won't want to distract you. But I have seen one person run GKE. It's more about scale, the more services you need to run, the more it helps reduce the friction you are going through.

        1. 1

          I see. We will have a note about it.

  2. 2

    Did you happen to check out Approximated yet? https://approximated.app/

    It might be what you’re looking for.

    1. 1

      Doesn't seem to support GCP. Any other alternatives?

  3. 1

    If you're on GCP, why not use their managed load balancer? That should make everything easier and can be done from their web UI or automated with something like Terraform. That way you have one managed service that should handle everything in your list.

    If each host you deploy though has a unique domain name tied to it, then containerizing everything and running it on Kubernetes (GKE) is probably more scalable long term. Sure it's got a bit of a learning curve, but once you learn it you'll unlock a whole new level of scaling capabilities.

    1. 1

      Do you mean not using nginx and using lb alone ? Is it possible for rate limiting?

      1. 1

        Yeah thats definitely an option. Or you can use the LB to terminate SSL and proxy to your host which could run nginx to proxy to various apps/servers/processes running (i.e. if you had multiple web apps, but only one host machine).

        Is it possible for rate limiting?

        Depends on what you want to rate limit. If you're looking to do rate limiting for a user's account, for example, I would handle that either in your webserver or you could probably use openresty to do it in nginx directly if you wanted.

        The benefit of running GCP's load balancer in front of everything is that it abstracts away the hardware running your app/webserver. This way you could have a single host or hundreds of hosts and dont have to worry about loadbalancing between all of them yourself.

        1. 1

          Just for clarity, can you please confirm the below

          1. LB's can't rate limit per api key. We need to go for reverse proxy for rate limiting
          2. We need minimum 2 reverse proxy instances behind a LB for highly available right?

          Can we add load balancer at later stage or its easy to get it up and runnign quickly?

          1. 1

            LB's can't rate limit per api key. We need to go for reverse proxy for rate limiting

            Correct, this would be up to you to implement in your own server logic.

            We need minimum 2 reverse proxy instances behind a LB for highly available right?

            Provided they are on two different hosts, yeah. Otherwise theres nothing wrong with running a single GCP instance that sits behind the load balancer. The big advantage of using the load balancer in the first place is that you can dynamically manage a pool of GCP instances it connects to to make your scaling more elastic.

            1. 1

              "The big advantage of using the load balancer in the first place is that you can dynamically manage a pool of GCP instances it connects" - Masterpiece!

              I will see if i can use second instance as micro instance which is free :)

              Thanks for that. I will right away do that now!

  4. 1

    I believe our low/no code tool could really help https://glasc.io/leza/ with the added over the top benefit of having a flexible security gateway. If it's something you would like to explore our Leza engineers would be more than happy to jump on a call and help you out with your challenge

  5. 1

    I would advise nginx with configs managed using Ansible or Puppet.
    For further insights in the usage I can give you a free trial of my new product: https://callcounter.eu Let me know if you're interested, so we can discuss what platform your microservices are written in etc.

  6. 1

    https://github.com/rmamba/letsproxy

    no api yet but feel free to sponsor it 😀

    p.s. can give you a quick demo so you don't need to install it to test it out ;)

  7. 1

    Traefik and Nginx OpenResty.

    Traefik is probably the easiest to use, once you have it set up, service discovery takes care of everything.

    OpenResty is great if you are hosting on non-cloud platforms, being able to use lua to add steps while still being super preformant is great (oidc, CF like JavaScript checking)

    1. 1

      Thanks for sharing. I'm not sure how service discovery works though. Will try with Traefik first.