From 30b5d4bfa383a0bbfae29ddb89f191c1541c5e36 Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Mon, 30 Aug 2021 15:53:09 +0200 Subject: [PATCH] Modif config nginx pour servir static statiquement --- app/static/README | 2 +- tools/etc/scodoc9.nginx | 13 ++++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/app/static/README b/app/static/README index 42b1b717c8..29e9483aa2 100644 --- a/app/static/README +++ b/app/static/README @@ -1 +1 @@ -Static content served directly by Apache. +Static content served directly by nginx. diff --git a/tools/etc/scodoc9.nginx b/tools/etc/scodoc9.nginx index dbc31caf06..05f55bee1c 100644 --- a/tools/etc/scodoc9.nginx +++ b/tools/etc/scodoc9.nginx @@ -28,10 +28,17 @@ server { proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } - - location /static { + location /ScoDoc/static { # handle static files directly, without forwarding to the application alias /opt/scodoc/app/static; - expires 5d; + expires 1d; + } + location /ScoDoc/static/bootstrap { + # (temp.) exception: home page using flask_bootstrap ! + proxy_pass http://localhost:8000; + proxy_redirect off; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } }