Skip to content

Commit 23e947e

Browse files
committed
using ngx_http_sub_module for injecting CSS
1 parent b3522d1 commit 23e947e

File tree

3 files changed

+25
-90
lines changed

3 files changed

+25
-90
lines changed

Diff for: nginx/Dockerfile

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ FROM nginx
33
MAINTAINER "Ivan Ermilov <mailto:[email protected]>"
44

55
COPY default.conf /etc/nginx/conf.d/default.conf
6-
COPY custom.html /data/bde-css/custom.html
6+
COPY materialize.min.css /data/bde-css/materialize.min.css
7+
COPY bde-hadoop.css /data/bde-css/bde-hadoop.css

Diff for: nginx/custom.html

-77
This file was deleted.

Diff for: nginx/default.conf

+23-12
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,33 @@ server {
33
server_name localhost;
44

55
root /data;
6-
add_after_body /bde-css/custom.html;
6+
gzip on;
77

88
location / {
9-
proxy_http_version 1.1;
10-
proxy_set_header Upgrade $http_upgrade;
11-
proxy_set_header Connection 'upgrade';
12-
proxy_cache_bypass $http_upgrade;
13-
proxy_set_header Host $host;
14-
proxy_set_header X-Real-IP $remote_addr;
15-
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
16-
proxy_set_header X-NginX-Proxy true;
17-
proxy_redirect off;
18-
proxy_pass http://namenode:50070;
19-
#rewrite ^/sparql/(.*)$ /$1 break;
9+
proxy_pass http://127.0.0.1:8000;
10+
proxy_set_header Accept-Encoding "";
2011
}
2112

2213
location /bde-css/ {
2314
}
2415
}
16+
17+
server {
18+
listen 127.0.0.1:8000;
19+
location / {
20+
proxy_pass http://127.0.0.1:8001;
21+
sub_filter '</head>' '<link rel="stylesheet" type="text/css" href="/bde-css/materialize.min.css">
22+
<link rel="stylesheet" type="text/css" href="/bde-css/bde-hadoop.css"></head>';
23+
sub_filter_once on;
24+
proxy_set_header Accept-Encoding "";
25+
}
26+
}
27+
28+
server {
29+
listen 127.0.0.1:8001;
30+
gunzip on;
31+
location / {
32+
proxy_pass http://namenode:50070;
33+
proxy_set_header Accept-Encoding gzip;
34+
}
35+
}

0 commit comments

Comments
 (0)