Err_connection_refused 443

### 1. Caddy version (`caddy version`):
`v2.4.5 h1:P1mRs6V2cMcagSPn+NWpD+OEYUYLIf6ecOa48cFGeUg=`
### 2. How I run Caddy:
`Public vps server`
#### a. System environment:
`ubuntu 20.04`

Paste command here.
caddy reverse-proxy --from --to localhost:10000

#### c. Service/unit/compose file:
`Docker > works if i run caddy with caddy reverse-proxy --from --to localhost:10000`

d. My complete Caddyfile or JSON config:

# The Caddyfile is an easy way to configure your Caddy web server.
# Unless the file starts with a global options block, the first
# uncommented line is always the address of your site.
# To use your own domain name (with automatic HTTPS), first make
# sure your domain's A/AAAA DNS records are properly pointed to
# this machine's public IP, then replace ":80" below with your
# domain name. {
        # Set this path to your site's directory.
        root * /usr/share/caddy

        # Enable the static file server.

        # Another common task is to set up a reverse proxy:
        reverse_proxy localhost:10000

        # Or serve a PHP site through php-fpm:
        # php_fastcgi localhost:9000

3. The problem I’m having:

If i run caddy with caddy start reverse proxy does not seems to work
when i stop caddy and run the lower command, my docker container works…
caddy reverse-proxy --from --to localhost:10000

### 4. Error messages and/or full log output:
sep 15 16:25:13 caddy[110940]: LOGNAME=caddy
sep 15 16:25:13 caddy[110940]: USER=caddy
sep 15 16:25:13 caddy[110940]: INVOCATION_ID=f1d037ce203d4bab8be76f8031c90a20
sep 15 16:25:13 caddy[110940]: JOURNAL_STREAM=8:4294461196
sep 15 16:25:13 caddy[110940]: {"level":"info","ts":1631715913.4884837,"msg":"using provided configuration","config_file":"/etc/caddy/Caddyfile","config_adapter":""}
sep 15 16:25:13 caddy[110940]: {"level":"warn","ts":1631715913.4894576,"msg":"input is not formatted with 'caddy fmt'","adapter":"caddyfile","file":"/etc/caddy/Caddyfile","line":1}
sep 15 16:25:13 caddy[110940]: run: loading initial config: loading new config: starting caddy administration endpoint: listen tcp bind: address already in use
sep 15 16:25:13 systemd[1]: Started Caddy.
sep 15 16:25:13 systemd[1]: caddy.service: Main process exited, code=exited, status=1/FAILURE
sep 15 16:25:13 systemd[1]: caddy.service: Failed with result 'exit-code'.

5. What I already tried:

unbind port 2019
full reboot

The formatting of your post is all broken. Please fix it! It’s very difficult to read. I suggest trying again from the help topic template. Please follow the instructions, and make sure there aren’t extra ``` (code fences) inserted when pasting, which break the formatting.

I’m very sorry, i’m new to this… i think its better now?

There’s missing some details. How did you install Caddy, exactly?

Essentially, you’re trying to run a second instance of Caddy while one is already running.

Indeed, but even when i stop and restart the service (caddy), it’s keeping this error… i look in to this :slight_smile:

Again, how did you install Caddy, exactly? That’s key to helping you here.

I just follewed the Install — Caddy Documentation without doing edits…
This was recomended after installing Get started - Budibase Docs (docker)

If you installed Caddy this way, then Caddy will already be running as a systemd service.

You should modify the Caddyfile at /etc/caddy/Caddyfile to do what you need.

Don’t use the caddy reverse-proxy command, that’s meant for development on your local machine when you just need something quick to spin up.

Those budibase docs should not recommend using caddy reverse-proxy.

Please make sure to also read this page in the docs:

Ok i adjusted the

to {
tls xxx

    handle {
            reverse_proxy localhost:10000


i’ll reboot and check if it’s running automatic now…

Thank you :slight_smile:

The handle is redundant in this case.

Also, make sure to use backticks ``` on the lines before and after your config, to use code formatting when posting on the forums. It’s important, so that it’s easy to read, and so whitespace is preserved.

All you need, probably, is this: {
	reverse_proxy localhost:10000

Thanks :slight_smile: i reinstalled caddy and will try this comf :slight_smile:

Thanks for all the help :slight_smile: everything is working now :slight_smile:

This topic was automatically closed after 30 days. New replies are no longer allowed.