Tuesday, 4 April 2017

Certbot + Shiny server - how to add HTTPS certs?

I have created the HTTPS certs for my Shiny and Node apps.

This is how I add the cert into my Shiny server, following this answer:

# Instruct Shiny Server to run applications as the user "shiny"
run_as shiny;

# Example: Define a server that listens on port 3838
server {
  listen 3838;
  server_name openair.example.net;
  location / { # Define a location at the base URL
    site_dir /usr/local/chroot/csshiny/openair.example.net; # Host a direct
    log_dir /var/log/shiny-openair.example.net; # Log all Shiny output to t
    directory_index on; # Show a list of available applications at the base URL
  }
}

server {
  listen 3838;
  server_name devopenair.example.net;
  location / { # Define a location at the base URL
    site_dir /usr/local/chroot/csshiny/devopenair.example.net; # Host a dir
    log_dir /var/log/shiny-devopenair.example.net; # Log all Shiny output t
    directory_index on; # Show a list of available applications at the base URL
  }
}

server {
  listen 3888;
  ssl /etc/letsencrypt/live/example.co.uk/privkey.pem /etc/letsencrypt/live/example.co.uk/cert.pem;
  location / { # Define a location at the base URL
    site_dir /usr/local/chroot/csshiny/devopenair.example.net; # Host a dir
    log_dir /var/log/shiny-devopenair.example.net; # Log all Shiny output t
    directory_index on; # Show a list of available applications at the base URL
  }
}

But this change has killed all my shiny apps!

Any ideas what I have done wrong?

Btw, can I share the same cert above with my nodeJS app?



via teelou

No comments:

Post a Comment