improve webserver, add domain redirects (aliases), add tests and admin page ui to manage the config
- make builtin http handlers serve on specific domains, such as for mta-sts, so
e.g. /.well-known/mta-sts.txt isn't served on all domains.
- add logging of a few more fields in access logging.
- small tweaks/bug fixes in webserver request handling.
- add config option for redirecting entire domains to another (common enough).
- split httpserver metric into two: one for duration until writing header (i.e.
performance of server), another for duration until full response is sent to
client (i.e. performance as perceived by users).
- add admin ui, a new page for managing the configs. after making changes
and hitting "save", the changes take effect immediately. the page itself
doesn't look very well-designed (many input fields, makes it look messy). i
have an idea to improve it (explained in admin.html as todo) by making the
layout look just like the config file. not urgent though.
i've already changed my websites/webapps over.
the idea of adding a webserver is to take away a (the) reason for folks to want
to complicate their mox setup by running an other webserver on the same machine.
i think the current webserver implementation can already serve most common use
cases. with a few more tweaks (feedback needed!) we should be able to get to 95%
of the use cases. the reverse proxy can take care of the remaining 5%.
nevertheless, a next step is still to change the quickstart to make it easier
for folks to run with an existing webserver, with existing tls certs/keys.
that's how this relates to issue #5.
2023-03-02 20:15:54 +03:00
|
|
|
Domains:
|
|
|
|
mox.example:
|
|
|
|
LocalpartCaseSensitive: false
|
|
|
|
Accounts:
|
|
|
|
mjl:
|
|
|
|
Domain: mox.example
|
|
|
|
Destinations:
|
2023-03-10 00:07:37 +03:00
|
|
|
mjl@mox.example: nil
|
improve webserver, add domain redirects (aliases), add tests and admin page ui to manage the config
- make builtin http handlers serve on specific domains, such as for mta-sts, so
e.g. /.well-known/mta-sts.txt isn't served on all domains.
- add logging of a few more fields in access logging.
- small tweaks/bug fixes in webserver request handling.
- add config option for redirecting entire domains to another (common enough).
- split httpserver metric into two: one for duration until writing header (i.e.
performance of server), another for duration until full response is sent to
client (i.e. performance as perceived by users).
- add admin ui, a new page for managing the configs. after making changes
and hitting "save", the changes take effect immediately. the page itself
doesn't look very well-designed (many input fields, makes it look messy). i
have an idea to improve it (explained in admin.html as todo) by making the
layout look just like the config file. not urgent though.
i've already changed my websites/webapps over.
the idea of adding a webserver is to take away a (the) reason for folks to want
to complicate their mox setup by running an other webserver on the same machine.
i think the current webserver implementation can already serve most common use
cases. with a few more tweaks (feedback needed!) we should be able to get to 95%
of the use cases. the reverse proxy can take care of the remaining 5%.
nevertheless, a next step is still to change the quickstart to make it easier
for folks to run with an existing webserver, with existing tls certs/keys.
that's how this relates to issue #5.
2023-03-02 20:15:54 +03:00
|
|
|
WebDomainRedirects:
|
|
|
|
redir.mox.example: mox.example
|
|
|
|
WebHandlers:
|
2023-03-09 01:29:44 +03:00
|
|
|
-
|
|
|
|
LogName: redirhttps
|
|
|
|
Domain: schemeredir.example
|
|
|
|
PathRegexp: ^/
|
|
|
|
DontRedirectPlainHTTP: true
|
|
|
|
WebRedirect:
|
|
|
|
BaseURL: https://schemeredir.example
|
improve webserver, add domain redirects (aliases), add tests and admin page ui to manage the config
- make builtin http handlers serve on specific domains, such as for mta-sts, so
e.g. /.well-known/mta-sts.txt isn't served on all domains.
- add logging of a few more fields in access logging.
- small tweaks/bug fixes in webserver request handling.
- add config option for redirecting entire domains to another (common enough).
- split httpserver metric into two: one for duration until writing header (i.e.
performance of server), another for duration until full response is sent to
client (i.e. performance as perceived by users).
- add admin ui, a new page for managing the configs. after making changes
and hitting "save", the changes take effect immediately. the page itself
doesn't look very well-designed (many input fields, makes it look messy). i
have an idea to improve it (explained in admin.html as todo) by making the
layout look just like the config file. not urgent though.
i've already changed my websites/webapps over.
the idea of adding a webserver is to take away a (the) reason for folks to want
to complicate their mox setup by running an other webserver on the same machine.
i think the current webserver implementation can already serve most common use
cases. with a few more tweaks (feedback needed!) we should be able to get to 95%
of the use cases. the reverse proxy can take care of the remaining 5%.
nevertheless, a next step is still to change the quickstart to make it easier
for folks to run with an existing webserver, with existing tls certs/keys.
that's how this relates to issue #5.
2023-03-02 20:15:54 +03:00
|
|
|
-
|
|
|
|
LogName: static
|
|
|
|
Domain: mox.example
|
|
|
|
PathRegexp: ^/static/
|
|
|
|
DontRedirectPlainHTTP: true
|
2023-08-21 22:52:35 +03:00
|
|
|
Compress: true
|
improve webserver, add domain redirects (aliases), add tests and admin page ui to manage the config
- make builtin http handlers serve on specific domains, such as for mta-sts, so
e.g. /.well-known/mta-sts.txt isn't served on all domains.
- add logging of a few more fields in access logging.
- small tweaks/bug fixes in webserver request handling.
- add config option for redirecting entire domains to another (common enough).
- split httpserver metric into two: one for duration until writing header (i.e.
performance of server), another for duration until full response is sent to
client (i.e. performance as perceived by users).
- add admin ui, a new page for managing the configs. after making changes
and hitting "save", the changes take effect immediately. the page itself
doesn't look very well-designed (many input fields, makes it look messy). i
have an idea to improve it (explained in admin.html as todo) by making the
layout look just like the config file. not urgent though.
i've already changed my websites/webapps over.
the idea of adding a webserver is to take away a (the) reason for folks to want
to complicate their mox setup by running an other webserver on the same machine.
i think the current webserver implementation can already serve most common use
cases. with a few more tweaks (feedback needed!) we should be able to get to 95%
of the use cases. the reverse proxy can take care of the remaining 5%.
nevertheless, a next step is still to change the quickstart to make it easier
for folks to run with an existing webserver, with existing tls certs/keys.
that's how this relates to issue #5.
2023-03-02 20:15:54 +03:00
|
|
|
WebStatic:
|
|
|
|
# This is run from the http package.
|
2023-08-21 22:52:35 +03:00
|
|
|
Root: ../testdata/webserver
|
improve webserver, add domain redirects (aliases), add tests and admin page ui to manage the config
- make builtin http handlers serve on specific domains, such as for mta-sts, so
e.g. /.well-known/mta-sts.txt isn't served on all domains.
- add logging of a few more fields in access logging.
- small tweaks/bug fixes in webserver request handling.
- add config option for redirecting entire domains to another (common enough).
- split httpserver metric into two: one for duration until writing header (i.e.
performance of server), another for duration until full response is sent to
client (i.e. performance as perceived by users).
- add admin ui, a new page for managing the configs. after making changes
and hitting "save", the changes take effect immediately. the page itself
doesn't look very well-designed (many input fields, makes it look messy). i
have an idea to improve it (explained in admin.html as todo) by making the
layout look just like the config file. not urgent though.
i've already changed my websites/webapps over.
the idea of adding a webserver is to take away a (the) reason for folks to want
to complicate their mox setup by running an other webserver on the same machine.
i think the current webserver implementation can already serve most common use
cases. with a few more tweaks (feedback needed!) we should be able to get to 95%
of the use cases. the reverse proxy can take care of the remaining 5%.
nevertheless, a next step is still to change the quickstart to make it easier
for folks to run with an existing webserver, with existing tls certs/keys.
that's how this relates to issue #5.
2023-03-02 20:15:54 +03:00
|
|
|
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.
|
2023-08-21 22:52:35 +03:00
|
|
|
Root: ../testdata/webserver/static
|
improve webserver, add domain redirects (aliases), add tests and admin page ui to manage the config
- make builtin http handlers serve on specific domains, such as for mta-sts, so
e.g. /.well-known/mta-sts.txt isn't served on all domains.
- add logging of a few more fields in access logging.
- small tweaks/bug fixes in webserver request handling.
- add config option for redirecting entire domains to another (common enough).
- split httpserver metric into two: one for duration until writing header (i.e.
performance of server), another for duration until full response is sent to
client (i.e. performance as perceived by users).
- add admin ui, a new page for managing the configs. after making changes
and hitting "save", the changes take effect immediately. the page itself
doesn't look very well-designed (many input fields, makes it look messy). i
have an idea to improve it (explained in admin.html as todo) by making the
layout look just like the config file. not urgent though.
i've already changed my websites/webapps over.
the idea of adding a webserver is to take away a (the) reason for folks to want
to complicate their mox setup by running an other webserver on the same machine.
i think the current webserver implementation can already serve most common use
cases. with a few more tweaks (feedback needed!) we should be able to get to 95%
of the use cases. the reverse proxy can take care of the remaining 5%.
nevertheless, a next step is still to change the quickstart to make it easier
for folks to run with an existing webserver, with existing tls certs/keys.
that's how this relates to issue #5.
2023-03-02 20:15:54 +03:00
|
|
|
-
|
|
|
|
LogName: httpsredir
|
|
|
|
Domain: mox.example
|
|
|
|
PathRegexp: ^/tls/
|
|
|
|
WebStatic:
|
|
|
|
# This is run from the http package.
|
2023-08-21 22:52:35 +03:00
|
|
|
Root: ../testdata/webserver/static
|
improve webserver, add domain redirects (aliases), add tests and admin page ui to manage the config
- make builtin http handlers serve on specific domains, such as for mta-sts, so
e.g. /.well-known/mta-sts.txt isn't served on all domains.
- add logging of a few more fields in access logging.
- small tweaks/bug fixes in webserver request handling.
- add config option for redirecting entire domains to another (common enough).
- split httpserver metric into two: one for duration until writing header (i.e.
performance of server), another for duration until full response is sent to
client (i.e. performance as perceived by users).
- add admin ui, a new page for managing the configs. after making changes
and hitting "save", the changes take effect immediately. the page itself
doesn't look very well-designed (many input fields, makes it look messy). i
have an idea to improve it (explained in admin.html as todo) by making the
layout look just like the config file. not urgent though.
i've already changed my websites/webapps over.
the idea of adding a webserver is to take away a (the) reason for folks to want
to complicate their mox setup by running an other webserver on the same machine.
i think the current webserver implementation can already serve most common use
cases. with a few more tweaks (feedback needed!) we should be able to get to 95%
of the use cases. the reverse proxy can take care of the remaining 5%.
nevertheless, a next step is still to change the quickstart to make it easier
for folks to run with an existing webserver, with existing tls certs/keys.
that's how this relates to issue #5.
2023-03-02 20:15:54 +03:00
|
|
|
-
|
|
|
|
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
|
improve http request handling for internal services and multiple domains
per listener, you could enable the admin/account/webmail/webapi handlers. but
that would serve those services on their configured paths (/admin/, /,
/webmail/, /webapi/) on all domains mox would be webserving, including any
non-mail domains. so your www.example/admin/ would be serving the admin web
interface, with no way to disabled that.
with this change, the admin interface is only served on requests to (based on
Host header):
- ip addresses
- the listener host name (explicitly configured in the listener, with fallback
to global hostname)
- "localhost" (for ssh tunnel/forwarding scenario's)
the account/webmail/webapi interfaces are served on the same domains as the
admin interface, and additionally:
- the client settings domains, as optionally configured in each Domain in
domains.conf. typically "mail.<yourdomain>".
this means the internal services are no longer served on other domains
configured in the webserver, e.g. www.example.org/admin/ will not be handled
specially.
the order of evaluation of routes/services is also changed:
before this change, the internal handlers would always be evaluated first.
with this change, only the system handlers for
MTA-STS/autoconfig/ACME-validation will be evaluated first. then the webserver
handlers. and finally the internal services (admin/account/webmail/webapi).
this allows an admin to configure overrides for some of the domains (per
hostname-matching rules explained above) that would normally serve these
services.
webserver handlers can now be configured that pass the request to an internal
service: in addition to the existing static/redirect/forward config options,
there is now an "internal" config option, naming the service
(admin/account/webmail/webapi) for handling the request. this allows enabling
the internal services on custom domains.
for issue #160 by TragicLifeHu, thanks for reporting!
2024-05-11 12:13:14 +03:00
|
|
|
-
|
|
|
|
LogName: xadmin
|
|
|
|
Domain: mox.example
|
|
|
|
PathRegexp: ^/xadmin/
|
|
|
|
DontRedirectPlainHTTP: true
|
|
|
|
WebInternal:
|
|
|
|
BasePath: /xadmin/
|
|
|
|
Service: admin
|
|
|
|
-
|
|
|
|
LogName: xaccount
|
|
|
|
Domain: mox.example
|
|
|
|
PathRegexp: ^/xaccount/
|
|
|
|
DontRedirectPlainHTTP: true
|
|
|
|
WebInternal:
|
|
|
|
BasePath: /xaccount/
|
|
|
|
Service: account
|
|
|
|
-
|
|
|
|
LogName: xwebmail
|
|
|
|
Domain: mox.example
|
|
|
|
PathRegexp: ^/xwebmail/
|
|
|
|
DontRedirectPlainHTTP: true
|
|
|
|
WebInternal:
|
|
|
|
BasePath: /xwebmail/
|
|
|
|
Service: webmail
|
|
|
|
-
|
|
|
|
LogName: xwebapi
|
|
|
|
Domain: mox.example
|
|
|
|
PathRegexp: ^/xwebapi/
|
|
|
|
DontRedirectPlainHTTP: true
|
|
|
|
WebInternal:
|
|
|
|
BasePath: /xwebapi/
|
|
|
|
Service: webapi
|
improve webserver, add domain redirects (aliases), add tests and admin page ui to manage the config
- make builtin http handlers serve on specific domains, such as for mta-sts, so
e.g. /.well-known/mta-sts.txt isn't served on all domains.
- add logging of a few more fields in access logging.
- small tweaks/bug fixes in webserver request handling.
- add config option for redirecting entire domains to another (common enough).
- split httpserver metric into two: one for duration until writing header (i.e.
performance of server), another for duration until full response is sent to
client (i.e. performance as perceived by users).
- add admin ui, a new page for managing the configs. after making changes
and hitting "save", the changes take effect immediately. the page itself
doesn't look very well-designed (many input fields, makes it look messy). i
have an idea to improve it (explained in admin.html as todo) by making the
layout look just like the config file. not urgent though.
i've already changed my websites/webapps over.
the idea of adding a webserver is to take away a (the) reason for folks to want
to complicate their mox setup by running an other webserver on the same machine.
i think the current webserver implementation can already serve most common use
cases. with a few more tweaks (feedback needed!) we should be able to get to 95%
of the use cases. the reverse proxy can take care of the remaining 5%.
nevertheless, a next step is still to change the quickstart to make it easier
for folks to run with an existing webserver, with existing tls certs/keys.
that's how this relates to issue #5.
2023-03-02 20:15:54 +03:00
|
|
|
# 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
|