File tree 3 files changed +42
-34
lines changed
components/dashboard/conf
3 files changed +42
-34
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1
1
{{- $this := dict "root" . "gp" $.Values }}
2
2
include lib.resolver.conf;
3
- include lib.error-generic.conf;
4
-
5
3
6
4
#######################################################
7
5
# Reverse-proxy for server service
@@ -23,14 +21,6 @@ location / {
23
21
include lib.cors-headers.conf;
24
22
25
23
proxy_pass http://dashboard$request_uri;
26
-
27
- # # # Page Not Found
28
- # # Let's redirect the browser agent to the web app, if no resources are found in the locations specified here.
29
- # #
30
- # # This is derived from the issue https://github.com/gitpod-io/gitpod/issues/2659, which
31
- # # was appearently caused by Twitter's link shortening. So, if the leading www is missing
32
- # # in the URL by accident, we will redirect to the web on 404 – Not Found.
33
- # error_page 404 @error_404_dashboard;
34
24
}
35
25
36
26
# location @error_404_dashboard {
@@ -194,4 +184,4 @@ location @error_404 {
194
184
location @error_generic {
195
185
# Something really bad happened: One of the requested resources is not there, at all. Redirect to the generic error page
196
186
return 302 {{ template "gitpod.scheme" $this }}://{{.Values.hostname}}/sorry/#Error%20$upstream_status;
197
- }
187
+ }
Original file line number Diff line number Diff line change 13
13
}
14
14
}
15
15
16
- :80 {
17
- @static {
16
+ (static) {
17
+ @static_path {
18
+ path /static/*
19
+ }
20
+
21
+ @static_asset {
22
+ file
18
23
path /static/*
19
24
}
20
25
21
- @notstatic {
26
+ # static assets configure cache headers and do not check for changes
27
+ header @static_asset {
28
+ Cache-Control "public, max-age=31536000"
29
+ # remove Last-Modified header
30
+ -Last-Modified
31
+ }
32
+ }
33
+
34
+ (notstatic) {
35
+ @not_static_path {
36
+ not path /static/*
37
+ }
38
+
39
+ @not_static_assets {
22
40
not path /static/*
23
41
}
24
42
43
+ header @not_static_assets {
44
+ Cache-Control "no-cache, no-transform, must-revalidate"
45
+ }
46
+ }
47
+
48
+ :80 {
25
49
import compression
26
50
import discard_log
51
+ import static
52
+ import notstatic
27
53
28
54
redir /.well-known/security.txt https://www.gitpod.io/.well-known/security.txt permanent
29
55
redir /environment-variables /settings/ permanent
30
56
31
- handle @static {
32
- header Cache-Control "public, max-age=31536000"
33
- }
34
-
35
- handle @notstatic {
36
- header Cache-Control "no-cache, no-transform, must-revalidate"
37
- }
38
-
39
57
header -Server
40
- header -Last-Modified
41
58
42
59
root * /www
43
60
file_server
44
- try_files {path} {path} / /index.html
61
+
62
+ handle @static_path {
63
+ try_files {path}
64
+ }
65
+
66
+ handle @not_static_path {
67
+ try_files {path} {path} / /index.html
68
+ }
69
+
70
+ handle {
71
+ respond "404 - Not Found" 404
72
+ }
45
73
}
46
74
47
75
# health-check
You can’t perform that action at this time.
0 commit comments