Modif config nginx pour servir static statiquement

This commit is contained in:
Emmanuel Viennet 2021-08-30 15:53:09 +02:00
parent 4e836e61d3
commit 30b5d4bfa3
2 changed files with 11 additions and 4 deletions

View File

@ -1 +1 @@
Static content served directly by Apache.
Static content served directly by nginx.

View File

@ -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;
}
}