Skip to content
This repository has been archived by the owner on Jan 18, 2019. It is now read-only.

caddyfile

Steven Myers edited this page Nov 19, 2017 · 3 revisions

Hopefully this example implemenation will help you.

<domain name>,
<domain name>,
localhost:<port> {
  tls off
  gzip

  # serve the built client application
  root packages/screenerClient/dist

  # hand off these requests to the api-server
  proxy /api localhost:3000
  proxy /protected localhost:3000

  # admin api actions are controlled by basic auth
  basicauth /protected <admin_username> <admin_password>

  # remove /elastic so that the query works with elasticsearch
  proxy /elastic localhost:9200 {
    without /elastic
  }

  # protect the elastic route -- this lets you get to the database from the outside
  basicauth /elastic <elasticsearch_username> <elasticsearch_password>

  rewrite /home to /index.html
  ...
}
Clone this wiki locally