Skip to content

caddyfile

Farhad Makiabady edited this page Nov 2, 2018 · 1 revision

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
  ...
}