[extensions-web] openshift: improve nginx configuration.



commit fe784d12741f9651df4abd27d31deb4305b31c39
Author: Yuri Konotopov <ykonotopov gnome org>
Date:   Sat Dec 15 14:50:42 2018 +0400

    openshift: improve nginx configuration.
    
    1. Do not log favicon.ico, robots.txt and /health requests.
    2. Cache typical static files.

 openshift/docker/nginx/nginx.conf | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)
---
diff --git a/openshift/docker/nginx/nginx.conf b/openshift/docker/nginx/nginx.conf
index 33ac82f..a539321 100644
--- a/openshift/docker/nginx/nginx.conf
+++ b/openshift/docker/nginx/nginx.conf
@@ -3,7 +3,6 @@ worker_processes  1;
 error_log  /var/log/nginx/error.log warn;
 pid        /var/run/nginx.pid;
 
-
 events {
     worker_connections  1024;
     use epoll;
@@ -44,7 +43,24 @@ http {
         add_header X-Frame-Options SAMEORIGIN;
         add_header X-UA-Compatible IE=Edge;
 
+        location = /favicon.ico {
+            log_not_found off;
+            access_log off;
+        }
+
+        location = /robots.txt {
+            allow all;
+            log_not_found off;
+            access_log off;
+        }
+
+        location ~* \.(jpg|jpeg|gif|png|ico|css|pdf|txt|bmp|js)$ {
+            access_log off;
+            expires 3d;
+        }
+
         location /health {
+            access_log off;
             return 200 "alive";
         }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]