This repository was archived by the owner on Sep 21, 2021. It is now read-only.
File tree 4 files changed +55
-2
lines changed
4 files changed +55
-2
lines changed Original file line number Diff line number Diff line change @@ -366,7 +366,7 @@ ENV ZAL_VER="${project.build.finalName}" \
366
366
SELENIUM_WAIT_FOR_CONTAINER="true"
367
367
368
368
COPY entry.sh log warn error /usr/bin/
369
- COPY nginx.conf /home/seluser/
369
+ COPY nginx.conf error.html /home/seluser/
370
370
COPY css/ /home/seluser/css/
371
371
COPY js/ /home/seluser/js/
372
372
COPY img/ /home/seluser/img/
Original file line number Diff line number Diff line change
1
+ <!DOCTYPE html>
2
+ < html >
3
+ < head >
4
+ < meta charset ="utf-8 ">
5
+ < title > Zalenium - <!--# echo var="status" default="" -->
6
+ <!--# if expr="$status_text" -->
7
+ - <!--# echo var="status_text" -->
8
+ <!--# endif -->
9
+ </ title >
10
+ < meta name ="viewport " content ="width=device-width, initial-scale=1 ">
11
+ < style >
12
+ h1 { text-align : center; }
13
+ address { text-align : center; }
14
+ </ style >
15
+ </ head >
16
+ < body >
17
+ < h1 > <!--# echo var="status" -->
18
+ <!--# if expr="$status_text" -->
19
+ - <!--# echo var="status_text" -->
20
+ <!--# endif -->
21
+ </ h1 >
22
+ < hr >
23
+ < address > nginx/<!--# echo var="nginx_version" --> - Zalenium {{zaleniumVersion}}</ address >
24
+ </ body >
25
+ </ html >
Original file line number Diff line number Diff line change @@ -10,9 +10,26 @@ http {
10
10
proxy_read_timeout 900s ;
11
11
send_timeout 900s ;
12
12
13
+ map $status $status_text {
14
+ 400 'Bad Request' ;
15
+ 401 'Unauthorized' ;
16
+ 403 'Forbidden' ;
17
+ 404 'Not Found' ;
18
+ 405 'Method Not Allowed' ;
19
+ 406 'Not Acceptable' ;
20
+ 413 'Payload Too Large' ;
21
+ 414 'URI Too Long' ;
22
+ 431 'Request Header Fields Too Large' ;
23
+ 500 'Internal Server Error' ;
24
+ 501 'Not Implemented' ;
25
+ 502 'Bad Gateway' ;
26
+ 503 'Service Unavailable' ;
27
+ 504 'Gateway Timeout' ;
28
+ }
29
+
13
30
server {
14
31
listen 4444 ;
15
-
32
+
16
33
satisfy any;
17
34
allow 127.0.0.1 ;
18
35
auth_basic_user_file /home/seluser/.htpasswd;
@@ -24,6 +41,16 @@ http {
24
41
}
25
42
auth_basic $auth_basic ;
26
43
44
+ error_page 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414
45
+ 415 416 417 418 421 422 423 424 426 428 429 431 451 500 501 502 503
46
+ 504 505 506 507 508 510 511 /error.html;
47
+
48
+ location = /error.html {
49
+ ssi on ;
50
+ internal ;
51
+ alias /home/seluser/error.html;
52
+ }
53
+
27
54
location {{contextPath}}/ {
28
55
rewrite ^{{contextPath}}/(.*) /$1 break;
29
56
# https://github.com/zalando/zalenium/issues/817
Original file line number Diff line number Diff line change @@ -489,6 +489,7 @@ StartUp()
489
489
# In nginx.conf, Replace {{contextPath}} with value of APPEND_CONTEXT_PATH
490
490
sed -i.bak " s~{{contextPath}}~${CONTEXT_PATH} ~" /home/seluser/nginx.conf
491
491
sed -i.bak " s~{{nginxMaxBodySize}}~${NGINX_MAX_BODY_SIZE} ~" /home/seluser/nginx.conf
492
+ sed -i.bak " s~{{zaleniumVersion}}~${project.version} ~" /home/seluser/error.html
492
493
493
494
echo " Starting Nginx reverse proxy..."
494
495
nginx -c /home/seluser/nginx.conf
You can’t perform that action at this time.
0 commit comments