File tree Expand file tree Collapse file tree 5 files changed +69
-8
lines changed Expand file tree Collapse file tree 5 files changed +69
-8
lines changed Original file line number Diff line number Diff line change @@ -8,9 +8,10 @@ resource "fastly_service_vcl" "frontend-vcl-service" {
8
8
name = " Frontend VCL Service - NGWAF edge deploy ${ var . USER_VCL_SERVICE_DOMAIN_NAME } "
9
9
10
10
product_enablement {
11
- origin_inspector = true
12
- domain_inspector = true
13
- bot_management = true
11
+ origin_inspector = true
12
+ domain_inspector = true
13
+ bot_management = true
14
+ log_explorer_insights = true
14
15
}
15
16
16
17
domain {
Original file line number Diff line number Diff line change
1
+ # ### Fastly VCL Service - Start
2
+ resource "fastly_service_vcl" "noop-vcl-service" {
3
+ name = " Frontend VCL Service - NGWAF edge deploy ${ var . USER_NOOP_SERVICE_DOMAIN_NAME } "
4
+
5
+ product_enablement {
6
+ origin_inspector = true
7
+ domain_inspector = true
8
+ bot_management = true
9
+ log_explorer_insights = true
10
+ }
11
+ domain {
12
+ name = var. USER_NOOP_SERVICE_DOMAIN_NAME
13
+ comment = " Frontend VCL Service - NGWAF edge deploy"
14
+ }
15
+
16
+ snippet {
17
+ name = " noop response caching"
18
+ content = file (" ${ path . module } /vcl/noop.vcl" )
19
+ type = " init"
20
+ priority = 100
21
+ }
22
+
23
+ force_destroy = true
24
+ }
25
+
26
+ output "noop_output" {
27
+ value = << tfmultiline
28
+
29
+ #### Click the URL to go to the Fastly VCL service ####
30
+ https://cfg.fastly.com/${ fastly_service_vcl . noop-vcl-service . id }
31
+
32
+ tfmultiline
33
+
34
+ description = " Output hints on what to do next."
35
+ }
36
+
Original file line number Diff line number Diff line change @@ -14,7 +14,12 @@ variable "USER_VCL_SERVICE_DOMAIN_NAME" {
14
14
variable "USER_VCL_SERVICE_BACKEND_HOSTNAME" {
15
15
type = string
16
16
description = " hostname used for backend."
17
- default = " http-me.glitch.me"
17
+ default = " http.edgecompute.app"
18
+ }
19
+
20
+ variable "USER_NOOP_SERVICE_DOMAIN_NAME" {
21
+ type = string
22
+ description = " noop service."
18
23
}
19
24
20
25
# ### VCL Service variables - End
Original file line number Diff line number Diff line change @@ -5,15 +5,23 @@ backend F_noop_origin {
5
5
.between_bytes_timeout = 10s ;
6
6
.connect_timeout = 1s ;
7
7
.first_byte_timeout = 1s ;
8
- .host = " 127.0.0.1 " ;
8
+ .host = " noop-caching.global.ssl.fastly.net " ;
9
9
.max_connections = 200 ;
10
10
.port = " 443" ;
11
11
.ssl = true ;
12
12
.max_tls_version = " 1.3" ;
13
- .min_tls_version = " 1.3 " ;
14
- .ssl_cert_hostname = " 127.0.0.1 " ;
13
+ .min_tls_version = " 1.1 " ;
14
+ .ssl_cert_hostname = " noop-caching.global.ssl.fastly.net " ;
15
15
.ssl_check_cert = always;
16
- .ssl_sni_hostname = " 127.0.0.1" ;
16
+ .ssl_sni_hostname = " noop-caching.global.ssl.fastly.net" ;
17
+ .probe = {
18
+ .dummy = true ;
19
+ .initial = 5 ;
20
+ .request = " HEAD / HTTP/1.1" " Host: noop-caching.global.ssl.fastly.net" " Connection: close" ;
21
+ .threshold = 1 ;
22
+ .timeout = 2s ;
23
+ .window = 5 ;
24
+ }
17
25
}
18
26
19
27
# force cluster for all requests and on restarts. https://www.fastly.com/documentation/guides/vcl/clustering/#enabling-and-disabling-clustering
Original file line number Diff line number Diff line change
1
+ sub vcl_recv {
2
+ error 600 ;
3
+ }
4
+
5
+ sub vcl_error {
6
+ if (obj.status == 600 ) {
7
+ set obj.status = 200 ;
8
+ set obj.response = " OK" ;
9
+ return (deliver );
10
+ }
11
+ }
You can’t perform that action at this time.
0 commit comments