Last updated:
To access forms – even during local development work – Formcentric Cloud applications need a domain to be entered in Formcentric in the Admin center under Organisation. This requires the setup of a proxy server.
Create a simple proxy server that forwards the requests to Formcentric via the domain that you have entered. SSL certificates do not need to be created.
Create a Caddyfile
configuration file for Caddy in your project:
DOMAIN.TLD {
tls internal
reverse_proxy http://docker.host.internal:4200
header {
Access-Control-Allow-Origin *
Access-Control-Allow-Methods "GET, POST, PUT, DELETE, OPTIONS"
Access-Control-Allow-Headers "Origin, X-Requested-With, Content-Type, Accept"
}
}
2. Create a docker-compose.yml
:
services:
caddy:
image: caddy:2.4.6-alpine
ports:
- '80:80'
- '443:443'
volumes:
- ./Caddyfile:/etc/caddy/Caddyfile
extra_hosts:
- 'docker.host.internal:host-gateway'
You can now start the proxy server by executing docker compose up -d in the same directory. You should now be able to reach the proxy server in your browser under https://DOMAIN.TLD
. As a final step, add the domain to your application’s configuration file: vite.config.ts
, webpack.config.ts
or angular.json
. Configure the domain under the host
key and start your development server.
You should now be able to see your application when you access the proxy server in your browser.
Modern bundlers and frameworks typically also offer direct configuration of the proxy server in your configuration files. To do this, consult the documentation for the technology that you are using: