|
| 1 | +static_resources: |
| 2 | + listeners: |
| 3 | + - name: main_listener |
| 4 | + address: |
| 5 | + socket_address: |
| 6 | + address: 0.0.0.0 |
| 7 | + port_value: 8080 |
| 8 | + filter_chains: |
| 9 | + - filters: |
| 10 | + - name: envoy.filters.network.http_connection_manager |
| 11 | + typed_config: |
| 12 | + "@type": type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager |
| 13 | + stat_prefix: ingress_http |
| 14 | + route_config: |
| 15 | + name: local_route |
| 16 | + max_direct_response_body_size_bytes: 104857600 |
| 17 | + virtual_hosts: |
| 18 | + - name: local_service |
| 19 | + domains: ["*"] |
| 20 | + routes: |
| 21 | + # ROUTE 1: Match gRPC-Web requests based on their content-type. |
| 22 | + # This route is checked first. |
| 23 | + - match: |
| 24 | + prefix: "/" |
| 25 | + headers: |
| 26 | + - name: "Content-Type" |
| 27 | + string_match: |
| 28 | + exact: "application/grpc-web-text" |
| 29 | + route: |
| 30 | + cluster: grpc_service_unix_socket |
| 31 | + timeout: 60s |
| 32 | + |
| 33 | + # ROUTE 2: Fallback for all other requests (e.g., your browser loading the page). |
| 34 | + # This route is checked only if the first one doesn't match. |
| 35 | + - match: |
| 36 | + path: "/" |
| 37 | + response_headers_to_add: |
| 38 | + - header: |
| 39 | + key: "Content-Type" |
| 40 | + value: "text/html" |
| 41 | + direct_response: |
| 42 | + status: 200 |
| 43 | + body: |
| 44 | + filename: "./index.html" |
| 45 | + - match: |
| 46 | + path: "/index.html" |
| 47 | + response_headers_to_add: |
| 48 | + - header: |
| 49 | + key: "Content-Type" |
| 50 | + value: "text/html" |
| 51 | + direct_response: |
| 52 | + status: 200 |
| 53 | + body: |
| 54 | + filename: "./index.html" |
| 55 | + - match: |
| 56 | + path: "/cardano-api.js" |
| 57 | + response_headers_to_add: |
| 58 | + - header: |
| 59 | + key: "Content-Type" |
| 60 | + value: "text/javascript" |
| 61 | + direct_response: |
| 62 | + status: 200 |
| 63 | + body: |
| 64 | + filename: "./cardano-api.js" |
| 65 | + - match: |
| 66 | + path: "/cardano-wasm.js" |
| 67 | + response_headers_to_add: |
| 68 | + - header: |
| 69 | + key: "Content-Type" |
| 70 | + value: "text/javascript" |
| 71 | + direct_response: |
| 72 | + status: 200 |
| 73 | + body: |
| 74 | + filename: "./cardano-wasm.js" |
| 75 | + - match: |
| 76 | + path: "/cardano-wasm.wasm" |
| 77 | + response_headers_to_add: |
| 78 | + - header: |
| 79 | + key: "Content-Type" |
| 80 | + value: "application/wasm" |
| 81 | + direct_response: |
| 82 | + status: 200 |
| 83 | + body: |
| 84 | + filename: "./cardano-wasm.wasm" |
| 85 | + - match: |
| 86 | + path: "/example.js" |
| 87 | + response_headers_to_add: |
| 88 | + - header: |
| 89 | + key: "Content-Type" |
| 90 | + value: "text/javascript" |
| 91 | + direct_response: |
| 92 | + status: 200 |
| 93 | + body: |
| 94 | + filename: "./example.js" |
| 95 | + - match: |
| 96 | + path: "/node_grpc_web_pb.js" |
| 97 | + response_headers_to_add: |
| 98 | + - header: |
| 99 | + key: "Content-Type" |
| 100 | + value: "text/javascript" |
| 101 | + direct_response: |
| 102 | + status: 200 |
| 103 | + body: |
| 104 | + filename: "./node_grpc_web_pb.js" |
| 105 | + http_filters: |
| 106 | + - name: envoy.filters.http.grpc_web |
| 107 | + typed_config: |
| 108 | + "@type": type.googleapis.com/envoy.extensions.filters.http.grpc_web.v3.GrpcWeb |
| 109 | + - name: envoy.filters.http.router |
| 110 | + typed_config: |
| 111 | + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router |
| 112 | + |
| 113 | + clusters: |
| 114 | + - name: grpc_service_unix_socket |
| 115 | + connect_timeout: 0.25s |
| 116 | + typed_extension_protocol_options: |
| 117 | + envoy.extensions.upstreams.http.v3.HttpProtocolOptions: |
| 118 | + "@type": type.googleapis.com/envoy.extensions.upstreams.http.v3.HttpProtocolOptions |
| 119 | + explicit_http_config: |
| 120 | + http2_protocol_options: {} |
| 121 | + load_assignment: |
| 122 | + cluster_name: grpc_service_unix_socket |
| 123 | + endpoints: |
| 124 | + - lb_endpoints: |
| 125 | + - endpoint: |
| 126 | + address: |
| 127 | + pipe: |
| 128 | + path: ../../rpc.socket |
0 commit comments