caddyserver / caddy

Fast and extensible multi-platform HTTP/1-2-3 web server with automatic HTTPS
https://caddyserver.com
Apache License 2.0
57.04k stars 3.99k forks source link

works not well with sniproxy #1467

Closed bitching closed 7 years ago

bitching commented 7 years ago

(Are you asking for help with using Caddy? Please use our forum instead: https://forum.caddyserver.com. If you are filing a bug report, please answer the following questions. If your issue is not a bug report, you do not need to use this template. Either way, please consider donating if we've helped you. Thanks!)

1. What version of Caddy are you running (caddy -version)?

0.9.5

2. What are you trying to do?

reuse port 443 ( run softhether & ocserv & caddy on a single vps, all of them use 443 by default, which sniproxy can handle them with different domain name ) nginx works properly but it's troublesome to use Let's Encrypt's certificate

3. What is your entire Caddyfile?

my.domain:444 {
  header / -Server
  root /var/www
  redir {
    if {scheme} not https
    to https://my.domain/
  }
}

www.my.domain:444 {
  header / -Server
  redir https://my.domain/
}

4. How did you run Caddy (give the full command and describe the execution environment)?

/usr/local/bin/caddy -agree=true -conf=/usr/local/bin/caddyfile

5. What did you expect to see?

5.1 https://www.my.domain works well with sniproxy 5.2 visit http://www.my.domain and return https://www.my.domain/

6. What did you see instead (give full error messages and/or log)?

6.1 https://www.my.domain works well with sniproxy【✓】 6.2 visit http://www.my.domain and return https://www.my.domain:444

mholt commented 7 years ago

Are you sure you want to redirect http://www.my.domain to https://www.my.domain/? From your redir https://my.domain/ line, it looks like you want to redirect http://www.my.domain to https://my.domain/.

mholt commented 7 years ago

Closing due to inactivity...