Skip to content

Commit

Permalink
using ngx_http_sub_module for injecting CSS
Browse files Browse the repository at this point in the history
  • Loading branch information
earthquakesan committed May 20, 2016
1 parent b3522d1 commit 23e947e
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 90 deletions.
3 changes: 2 additions & 1 deletion nginx/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ FROM nginx
MAINTAINER "Ivan Ermilov <mailto:[email protected]>"

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
77 changes: 0 additions & 77 deletions nginx/custom.html

This file was deleted.

35 changes: 23 additions & 12 deletions nginx/default.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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 '</head>' '<link rel="stylesheet" type="text/css" href="/bde-css/materialize.min.css">
<link rel="stylesheet" type="text/css" href="/bde-css/bde-hadoop.css"></head>';
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;
}
}

0 comments on commit 23e947e

Please sign in to comment.