Skip to content

Commit

Permalink
Allow specify host address and don't limit port (#8)
Browse files Browse the repository at this point in the history
The user can be more flexible in specifying the host address based on
https://caddyserver.com/docs/caddyfile/concepts#addresses

- example.com: both http and https
- http://example.com: http only
- https://example.com: https only

The http-only configuration may be desirable because some host platforms adds an
https in front of the server and makes all internal traffic http.
  • Loading branch information
xuhdev authored Jan 5, 2025
1 parent d4dae6c commit b82c1b1
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions Caddyfile.base
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@
admin off
}

{$DOMAIN:localhost}:80,
{$DOMAIN:localhost}:443 {
{$HOST_ADDRESS:localhost} {
redir /abc https://example.com
@snapshot path_regexp ^/snapshot/(\d\d\d\d-\d\d-\d\d)/(.*)$
redir @snapshot https://raw.githubusercontent.com/delpa-org/melpa-snapshot-{re.1}/refs/heads/master/packages/{re.2} permanent
Expand Down

0 comments on commit b82c1b1

Please sign in to comment.