Closed xiaoxintang closed 1 year ago
Thanks for opening an issue! We'll look into this.
It's not immediately clear to us what is going on, so we'll need your help to understand it better.
Ideally, we need to be able to reproduce the bug in the most minimal way possible. This allows us to write regression tests to verify the fix is working. If we can't reproduce it, then you'll have to test our changes for us until it's fixed -- and then we can't add test cases, either.
I've attached a template below that will help make this easier and faster! It will ask for some information you've already provided; that's OK, just fill it out the best you can. :+1:
I've also included some helpful tips below the template. Feel free to let me know if you have any questions!
Thank you again for your report, we look forward to resolving it!
## 1. Environment
### 1a. Operating system and version
```
paste here
```
### 1b. Caddy version (run `caddy version` or paste commit SHA)
```
paste here
```
### 1c. Go version (if building Caddy from source; run `go version`)
```
paste here
```
## 2. Description
### 2a. What happens (briefly explain what is wrong)
### 2b. Why it's a bug (if it's not obvious)
### 2c. Log output
```
paste terminal output or logs here
```
### 2d. Workaround(s)
### 2e. Relevant links
## 3. Tutorial (minimal steps to reproduce the bug)
Environment: Please fill out your OS and Caddy versions, even if you don't think they are relevant. (They are always relevant.) If you built Caddy from source, provide the commit SHA and specify your exact Go version.
Description: Describe at a high level what the bug is. What happens? Why is it a bug? Not all bugs are obvious, so convince readers that it's actually a bug.
Tutorial: What are the minimum required specific steps someone needs to take in order to experience the same bug? Your goal here is to make sure that anyone else can have the same experience with the bug as you do. You are writing a tutorial, so make sure to carry it out yourself before posting it. Please:
curl
.Example of a tutorial:
Create a config file: ``` { ... } ``` Open terminal and run Caddy: ``` $ caddy ... ``` Make an HTTP request: ``` $ curl ... ``` Notice that the result is ___ but it should be ___.
Ubuntu 22.04.2 LTS (GNU/Linux 5.15.0-1030-oracle x86_64)
caddy version
or paste commit SHA)v2.6.4 h1:2hwYqiRwk1tf3VruhMpLcYTg+11fCdr8S3jhNAdnPy8=
Docker version 23.0.1, build a5ee5b1
Docker Compose version v2.16.0
enter the server ip address ,the chrome browser show me ERR_CONNECTION_REFUSED
{"level":"info","ts":1680080423.2341442,"msg":"using provided configuration","config_file":"/etc/caddy/Caddyfile","config_adapter":"caddyfile"}
{"level":"info","ts":1680080423.2362368,"logger":"admin","msg":"admin endpoint started","address":"localhost:2019","enforce_origin":false,"origins":["//localhost:2019","//[::1]:2019","//127.0.0.1:2019"]}
{"level":"warn","ts":1680080423.236958,"logger":"http","msg":"server is listening only on the HTTP port, so no automatic HTTPS will be applied to this server","server_name":"srv0","http_port":80}
{"level":"info","ts":1680080423.237136,"logger":"http.log","msg":"server running","name":"srv0","protocols":["h1","h2","h3"]}
{"level":"info","ts":1680080423.2373943,"logger":"tls.cache.maintenance","msg":"started background certificate maintenance","cache":"0xc0004cd810"}
{"level":"info","ts":1680080423.2373989,"msg":"autosaved config (load with --resume flag)","file":"/config/caddy/autosave.json"}
{"level":"info","ts":1680080423.237465,"msg":"serving initial configuration"}
{"level":"info","ts":1680080423.2374237,"logger":"tls","msg":"cleaning storage unit","description":"FileStorage:/data/caddy"}
{"level":"info","ts":1680080423.237498,"logger":"tls","msg":"finished cleaning storage units"}
docker-compose.yaml
services:
gfw-web:
image: caddy
container_name: gfw-web
network_mode: host
run docker compose up -d -V
@francislavoie
What's your Caddyfile?
Show an example request with curl -v
. Run netstat -lntup
to show the ports Caddy has bound to.
it's inside
Caddyfile is default
on ubuntu host i run curl http://localhost
it's working。but i use browser it's refused
when i change my docker-compose.yaml
services:
gfw-web:
image: caddy
container_name: gfw-web
ports:
- 80:80
- 443:443
it's work on ubuntu host & browser with the same ip address @francislavoie
on ubuntu host i run curl http://localhost it's working。but i use browser it's refused
Then the problem isn't with Caddy.
Which machine are you making the request from when using the browser? The same as the one Caddy is running on, or a different one? What's the URL you used in your browser?
it's run on
Ubuntu 22.04.2 LTS (GNU/Linux 5.15.0-1030-oracle x86_64)
,using latest docker with compose v2there is my docker-compose.yaml