File tree Expand file tree Collapse file tree 5 files changed +41
-4
lines changed Expand file tree Collapse file tree 5 files changed +41
-4
lines changed Original file line number Diff line number Diff line change
1
+ SIGN_IN_URL = ' #'
Original file line number Diff line number Diff line change
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>MMLI: Unauthorized</title>
5
+ <script src="/env.js"></script>
6
+ </head>
7
+ <body>
8
+
9
+ <p>Unauthorized</p>
10
+
11
+ <a id='signInLink' href='#'>Sign In</a>
12
+
13
+ <script>
14
+ var origin = window.location.href;
15
+ var rd = encodeURIComponent(origin);
16
+ var href = `${SIGN_IN_URL}?rd=` + rd;
17
+ document.getElementById('signInLink').href = href;
18
+ window.location.href = href;
19
+ </script>
20
+
21
+ </body>
22
+ </html>
Original file line number Diff line number Diff line change 1
- FROM nginxinc/ nginx-unprivileged
1
+ FROM nginx:1
2
2
3
- COPY . /usr/share/nginx/html/
3
+ # Enable built-in interpolation of templates
4
+ ENV NGINX_ENVSUBST_TEMPLATE_DIR=/usr/share/nginx/templates \
5
+ NGINX_ENVSUBST_OUTPUT_DIR=/usr/share/nginx/html
6
+
7
+ # Define variables that will be interpolated
8
+ ENV SIGN_IN_URL='#'
9
+
10
+ # For templated HTML
11
+ COPY *.template ${NGINX_ENVSUBST_TEMPLATE_DIR}/
12
+
13
+ # For static HTML
14
+ # COPY *.html ${NGINX_ENVSUBST_OUTPUT_DIR}/
Original file line number Diff line number Diff line change 1
- version : ' 3.9'
2
-
3
1
services :
4
2
nginx-custom-errors :
5
3
container_name : ' nginx-custom-errors'
6
4
image : ' ndslabs/custom-errors'
5
+ env_file :
6
+ - .env
7
7
build :
8
8
context : .
9
9
ports :
Original file line number Diff line number Diff line change
1
+ window.env = {
2
+ "SIGN_IN_URL": "${SIGN_IN_URL}"
3
+ }
You can’t perform that action at this time.
0 commit comments