Question

Add HTTPS with R Plumber API

I just bought a domain and am trying to set up HTTPS redirection on my R Plumber API. I made sure that the droplet IP is pointing to the domain and checked that it works. So currently I can access the plumber API over HTTP. I have an SSL Certificate on DO with my domain name. I tried using a Load Balancer but that didn’t work. Any guidance for how I would proceed?

I also tried using the “do_connect_https” function from the plumberDeploy package, but I keep getting the error “Error: Authentication with ssh server failed”

I would be happy to provide any more details if needed. Thank you in advance


Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

Hi, If you deployed your R Plumber API with plumberDeploy package, then you have nginx installed and configured as reverse proxy for your R Plumber API. The only things you have to do are:

  • configure nginx server block to use SSL certificate
  • open port TCP 443 in firewall for https connections.

Questions:

1. What address and port does the R API listen on ? Execute the command:

sudo netstat -tulpn | grep R

2. How do you access R API in a browser ? I mean, what do you type in an address bar of a browser to get your API (e.g. http://mydomain.com/RAPI) ?

3. Do you know where you have your SSL certificate files stored ? You need to know it to configure nginx server block.

4. You probably use ufw to configure a firewall. Check if ufw is active and the port TCP 443 is listed:

sudo ufw status

5. Do you have DO Cloud Firewall active and configured for your droplet ? Check in DO control panel - Networking - Firewalls - configured firewall (if any) - Droplets.