Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MatchRemoteHost ¶
type MatchRemoteHost struct {
// Host names, whose corresponding IPs to match against
Hosts []string `json:"hosts,omitempty"`
// If true, prefer the first IP in the request's X-Forwarded-For
// header, if present, rather than the immediate peer's IP, as
// the reference IP against which to match. Note that it is easy
// to spoof request headers. Default: false
Forwarded bool `json:"forwarded,omitempty"`
// By default, DNS responses are cached for 60 seconds, regardless
// of the DNS record's TTL. Set nocache to true to disable this
// behavior and never use caching. Default: false
NoCache bool `json:"nocache,omitempty"`
// contains filtered or unexported fields
}
MatchRemoteHost matches based on the remote IP of the connection. A host name can be specified, whose A and AAAA DNS records will be resolved to a corresponding IP for matching.
Note that IPs can sometimes be spoofed, so do not rely on this as a replacement for actual authentication.
func (MatchRemoteHost) CaddyModule ¶
func (MatchRemoteHost) CaddyModule() caddy.ModuleInfo
CaddyModule returns the Caddy module information.
func (*MatchRemoteHost) Match ¶
func (m *MatchRemoteHost) Match(r *http.Request) bool
Match returns true if r matches m.
func (*MatchRemoteHost) Provision ¶
func (m *MatchRemoteHost) Provision(ctx caddy.Context) (err error)
Provision implements caddy.Provisioner.
func (*MatchRemoteHost) UnmarshalCaddyfile ¶
func (m *MatchRemoteHost) UnmarshalCaddyfile(d *caddyfile.Dispenser) error
UnmarshalCaddyfile implements caddyfile.Unmarshaler.
func (*MatchRemoteHost) Validate ¶
func (m *MatchRemoteHost) Validate() error
Validate implements caddy.Validator.
Click to show internal directories.
Click to hide internal directories.