Jump to content

Caddy: Difference between revisions

84 bytes added ,  31 July 2022
m
no edit summary
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".extraConfig = ''
caddy.virtualHosts."example.org" = {
  redir https://www.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]]
Anonymous user