Caddy: Difference between revisions
imported>Onny mNo edit summary |
imported>Onny mNo edit summary |
||
Line 20: | Line 20: | ||
=== Redirect === | === Redirect === | ||
Redirecting <code>example.org</code> to <code>www.example.org</code> | Redirecting <code>example.org</code> and <code>old.example.org</code> to <code>www.example.org</code> | ||
<syntaxhighlight lang="nix> | <syntaxhighlight lang="nix> | ||
caddy.virtualHosts."example.org" | caddy.virtualHosts."example.org" = { | ||
extraConfig = '' | |||
''; | redir https://www.example.org | ||
''; | |||
serverAlias = [ "old.example.org" ]; | |||
}; | |||
</syntaxhighlight> | </syntaxhighlight> | ||
== See also == | == See also == | ||
* [https://caddyserver.com/docs/ Official Caddy documentation] | * [https://caddyserver.com/docs/ Official Caddy documentation] | ||
[[Category:Applications]] | [[Category:Applications]] | ||
[[Category:Web Servers]] | [[Category:Web Servers]] |