X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=modules%2Fprivate%2Fwebsites%2Fchloe%2Fproduction.nix;h=578bf918cab22fecc52798a546560d1d731a3965;hb=33b5010fd03e27f02e97efdf9ddcb7c48ac3281c;hp=3d267f2494595774004608769ddd7f60d028c926;hpb=829ef7f1cb79f0171f9c5254278d93c48c44a7b5;p=perso%2FImmae%2FConfig%2FNix.git diff --git a/modules/private/websites/chloe/production.nix b/modules/private/websites/chloe/production.nix index 3d267f2..578bf91 100644 --- a/modules/private/websites/chloe/production.nix +++ b/modules/private/websites/chloe/production.nix @@ -33,7 +33,14 @@ in { certMainHost = "osteopathe-cc.fr"; hosts = ["osteopathe-cc.fr" "www.osteopathe-cc.fr" ]; root = chloe.apache.root; - extraConfig = [ chloe.apache.vhostConf ]; + extraConfig = [ + '' + RewriteEngine On + RewriteCond "%{HTTP_HOST}" "!^www\.osteopathe-cc\.fr$" [NC] + RewriteRule ^(.+)$ https://www.osteopathe-cc.fr$1 [R=302,L] + '' + chloe.apache.vhostConf + ]; }; services.websites.env.production.watchPaths = [ "/var/secrets/webapps/${chloe.app.environment}-chloe"