mirror of
https://github.com/mjl-/mox.git
synced 2025-07-03 01:48:17 +03:00

we only compress if applicable (content-type indicates likely compressible), client supports it, response doesn't already have a content-encoding). for internal handlers, we always enable compression. for reverse proxied and static files, compression must be enabled per handler. for internal & reverse proxy handlers, we do streaming compression at "bestspeed" quality (probably level 1). for static files, we have a cache based on mtime with fixed max size, where we evict based on least recently used. we compress with the default level (more cpu, better ratio).
94 lines
2.0 KiB
Plaintext
94 lines
2.0 KiB
Plaintext
Domains:
|
|
mox.example:
|
|
LocalpartCaseSensitive: false
|
|
Accounts:
|
|
mjl:
|
|
Domain: mox.example
|
|
Destinations:
|
|
mjl@mox.example: nil
|
|
WebDomainRedirects:
|
|
redir.mox.example: mox.example
|
|
WebHandlers:
|
|
-
|
|
LogName: redirhttps
|
|
Domain: schemeredir.example
|
|
PathRegexp: ^/
|
|
DontRedirectPlainHTTP: true
|
|
WebRedirect:
|
|
BaseURL: https://schemeredir.example
|
|
-
|
|
LogName: static
|
|
Domain: mox.example
|
|
PathRegexp: ^/static/
|
|
DontRedirectPlainHTTP: true
|
|
Compress: true
|
|
WebStatic:
|
|
# This is run from the http package.
|
|
Root: ../testdata/webserver
|
|
ListFiles: true
|
|
ResponseHeaders:
|
|
X-Test: mox
|
|
-
|
|
LogName: nolist
|
|
Domain: mox.example
|
|
PathRegexp: ^/nolist/
|
|
DontRedirectPlainHTTP: true
|
|
WebStatic:
|
|
StripPrefix: /nolist/
|
|
# This is run from the http package.
|
|
Root: ../testdata/webserver/static
|
|
-
|
|
LogName: httpsredir
|
|
Domain: mox.example
|
|
PathRegexp: ^/tls/
|
|
WebStatic:
|
|
# This is run from the http package.
|
|
Root: ../testdata/webserver/static
|
|
-
|
|
LogName: baseurlonly
|
|
Domain: mox.example
|
|
PathRegexp: ^/baseurl/
|
|
DontRedirectPlainHTTP: true
|
|
WebRedirect:
|
|
BaseURL: https://tls.mox.example?q=1#fragment
|
|
-
|
|
LogName: pathonly
|
|
Domain: mox.example
|
|
PathRegexp: ^/pathonly/
|
|
DontRedirectPlainHTTP: true
|
|
WebRedirect:
|
|
OrigPathRegexp: ^/pathonly/old/(.*)$
|
|
ReplacePath: /pathonly/new/$1
|
|
StatusCode: 307
|
|
-
|
|
LogName: baseurlpath
|
|
Domain: mox.example
|
|
PathRegexp: ^/baseurlpath/
|
|
DontRedirectPlainHTTP: true
|
|
WebRedirect:
|
|
BaseURL: //other.mox.example?q=1#fragment
|
|
OrigPathRegexp: ^/baseurlpath/old/(.*)$
|
|
ReplacePath: /baseurlpath/new/$1
|
|
# test code depends on these last two webhandlers being here.
|
|
-
|
|
LogName: strippath
|
|
Domain: mox.example
|
|
PathRegexp: ^/strip/
|
|
DontRedirectPlainHTTP: true
|
|
WebForward:
|
|
StripPath: true
|
|
# replaced while testing
|
|
URL: http://127.0.0.1:1/a
|
|
ResponseHeaders:
|
|
X-Test: mox
|
|
-
|
|
LogName: nostrippath
|
|
Domain: mox.example
|
|
PathRegexp: ^/nostrip/
|
|
DontRedirectPlainHTTP: true
|
|
WebForward:
|
|
# replaced while testing
|
|
URL: http://127.0.0.1:1/a
|
|
ResponseHeaders:
|
|
X-Test: mox
|