[odrs-web] Land static files against the nginx image and reference it within nginx.conf.
- From: Andrea Veri <averi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [odrs-web] Land static files against the nginx image and reference it within nginx.conf.
- Date: Thu, 28 Apr 2022 14:37:39 +0000 (UTC)
commit dd9ea2900ef884fab1b28cd6ee17461aa47c2497
Author: Andrea Veri <averi redhat com>
Date: Thu Apr 28 16:36:45 2022 +0200
Land static files against the nginx image and reference it within nginx.conf.
On top of that make sure static files are not served via gunicorn.
Dockerfile.nginx | 1 +
nginx.conf | 12 ++++++------
2 files changed, 7 insertions(+), 6 deletions(-)
---
diff --git a/Dockerfile.nginx b/Dockerfile.nginx
index d90751b..b747395 100644
--- a/Dockerfile.nginx
+++ b/Dockerfile.nginx
@@ -1,2 +1,3 @@
FROM docker.io/nginxinc/nginx-unprivileged
+ADD odrs/static /tmp/static
ADD nginx.conf /etc/nginx/nginx.conf
diff --git a/nginx.conf b/nginx.conf
index f0d2c06..8930a21 100644
--- a/nginx.conf
+++ b/nginx.conf
@@ -55,15 +55,15 @@ http {
proxy_pass http://odrs:8080/;
}
- location /1.0/reviews/api/ratings {
- alias /tmp/ratings/ratings.json;
- }
-
- location ~* \.(?:ico|css|svg|js|json|jpe?g|png)$ {
+ location /static {
+ alias /tmp/static
expires 30d;
add_header Pragma public;
add_header Cache-Control "public";
- proxy_pass http://odrs:8080;
+ }
+
+ location /1.0/reviews/api/ratings {
+ alias /tmp/ratings/ratings.json;
}
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]