From 23e947efffab9b3a93c3eae90831457908d74343 Mon Sep 17 00:00:00 2001 From: Ivan Ermilov Date: Fri, 20 May 2016 12:18:01 +0200 Subject: [PATCH] using ngx_http_sub_module for injecting CSS --- nginx/Dockerfile | 3 +- nginx/custom.html | 77 ---------------------------------------------- nginx/default.conf | 35 +++++++++++++-------- 3 files changed, 25 insertions(+), 90 deletions(-) delete mode 100644 nginx/custom.html diff --git a/nginx/Dockerfile b/nginx/Dockerfile index 2f88e28..436538b 100644 --- a/nginx/Dockerfile +++ b/nginx/Dockerfile @@ -3,4 +3,5 @@ FROM nginx MAINTAINER "Ivan Ermilov " COPY default.conf /etc/nginx/conf.d/default.conf -COPY custom.html /data/bde-css/custom.html +COPY materialize.min.css /data/bde-css/materialize.min.css +COPY bde-hadoop.css /data/bde-css/bde-hadoop.css diff --git a/nginx/custom.html b/nginx/custom.html deleted file mode 100644 index 5c68a96..0000000 --- a/nginx/custom.html +++ /dev/null @@ -1,77 +0,0 @@ - diff --git a/nginx/default.conf b/nginx/default.conf index e0a857a..d19ba35 100644 --- a/nginx/default.conf +++ b/nginx/default.conf @@ -3,22 +3,33 @@ server { server_name localhost; root /data; - add_after_body /bde-css/custom.html; + gzip on; location / { - proxy_http_version 1.1; - proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection 'upgrade'; - proxy_cache_bypass $http_upgrade; - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-NginX-Proxy true; - proxy_redirect off; - proxy_pass http://namenode:50070; - #rewrite ^/sparql/(.*)$ /$1 break; + proxy_pass http://127.0.0.1:8000; + proxy_set_header Accept-Encoding ""; } location /bde-css/ { } } + +server { + listen 127.0.0.1:8000; + location / { + proxy_pass http://127.0.0.1:8001; + sub_filter '' ' + '; + sub_filter_once on; + proxy_set_header Accept-Encoding ""; + } +} + +server { + listen 127.0.0.1:8001; + gunzip on; + location / { + proxy_pass http://namenode:50070; + proxy_set_header Accept-Encoding gzip; + } +}