Skip to content

Commit 4778709

Browse files
committed
GRPCRoute Support
1 parent b4b0772 commit 4778709

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+4701
-2210
lines changed

Makefile

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ TELEMETRY_ENDPOINT=# if empty, NGF will report telemetry in its logs at debug le
1616
TELEMETRY_ENDPOINT_INSECURE = false
1717

1818
GW_API_VERSION = 1.0.0
19+
ENABLE_EXPERIMENTAL = false
1920
NODE_VERSION = $(shell cat .nvmrc)
2021

2122
# go build flags - should not be overridden by the user
@@ -192,13 +193,13 @@ install-ngf-local-build-with-plus: build-images-with-plus load-images-with-plus
192193

193194
.PHONY: helm-install-local
194195
helm-install-local: ## Helm install NGF on configured kind cluster with local images. To build, load, and install with helm run make install-ngf-local-build.
195-
./conformance/scripts/install-gateway.sh $(GW_API_VERSION)
196-
helm install dev $(CHART_DIR) --create-namespace --wait --set service.type=NodePort --set nginxGateway.image.repository=$(PREFIX) --set nginxGateway.image.tag=$(TAG) --set nginxGateway.image.pullPolicy=Never --set nginx.image.repository=$(NGINX_PREFIX) --set nginx.image.tag=$(TAG) --set nginx.image.pullPolicy=Never -n nginx-gateway
196+
./conformance/scripts/install-gateway.sh $(GW_API_VERSION) $(ENABLE_EXPERIMENTAL)
197+
helm install dev $(CHART_DIR) --create-namespace --wait --set service.type=NodePort --set nginxGateway.image.repository=$(PREFIX) --set nginxGateway.image.tag=$(TAG) --set nginxGateway.image.pullPolicy=Never --set nginx.image.repository=$(NGINX_PREFIX) --set nginx.image.tag=$(TAG) --set nginx.image.pullPolicy=Never --set nginxGateway.gwAPIExperimentalFeatures.enable=$(ENABLE_EXPERIMENTAL) -n nginx-gateway
197198

198199
.PHONY: helm-install-local-with-plus
199200
helm-install-local-with-plus: ## Helm install NGF with NGINX Plus on configured kind cluster with local images. To build, load, and install with helm run make install-ngf-local-build-with-plus.
200-
./conformance/scripts/install-gateway.sh $(GW_API_VERSION)
201-
helm install dev $(CHART_DIR) --create-namespace --wait --set service.type=NodePort --set nginxGateway.image.repository=$(PREFIX) --set nginxGateway.image.tag=$(TAG) --set nginxGateway.image.pullPolicy=Never --set nginx.image.repository=$(NGINX_PLUS_PREFIX) --set nginx.image.tag=$(TAG) --set nginx.image.pullPolicy=Never --set nginx.plus=true -n nginx-gateway
201+
./conformance/scripts/install-gateway.sh $(GW_API_VERSION) $(ENABLE_EXPERIMENTAL)
202+
helm install dev $(CHART_DIR) --create-namespace --wait --set service.type=NodePort --set nginxGateway.image.repository=$(PREFIX) --set nginxGateway.image.tag=$(TAG) --set nginxGateway.image.pullPolicy=Never --set nginx.image.repository=$(NGINX_PLUS_PREFIX) --set nginx.image.tag=$(TAG) --set nginx.image.pullPolicy=Never --set nginx.plus=true --set nginxGateway.gwAPIExperimentalFeatures.enable=$(ENABLE_EXPERIMENTAL) -n nginx-gateway
202203

203204
# Debug Targets
204205
.PHONY: debug-build

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
NGINX Gateway Fabric is an open-source project that provides an implementation of
1313
the [Gateway API](https://gateway-api.sigs.k8s.io/) using [NGINX](https://nginx.org/) as the data plane. The goal of
14-
this project is to implement the core Gateway APIs -- `Gateway`, `GatewayClass`, `HTTPRoute`, `TCPRoute`, `TLSRoute`,
14+
this project is to implement the core Gateway APIs -- `Gateway`, `GatewayClass`, `HTTPRoute`, `GRPCRoute`, `TCPRoute`, `TLSRoute`,
1515
and `UDPRoute` -- to configure an HTTP or TCP/UDP load balancer, reverse-proxy, or API gateway for applications running
1616
on Kubernetes. NGINX Gateway Fabric supports a subset of the Gateway API.
1717

charts/nginx-gateway-fabric/templates/rbac.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ rules:
9292
- referencegrants
9393
{{- if .Values.nginxGateway.gwAPIExperimentalFeatures.enable }}
9494
- backendtlspolicies
95+
- grpcroutes
9596
{{- end }}
9697
verbs:
9798
- list
@@ -104,6 +105,7 @@ rules:
104105
- gatewayclasses/status
105106
{{- if .Values.nginxGateway.gwAPIExperimentalFeatures.enable }}
106107
- backendtlspolicies/status
108+
- grpcroutes/status
107109
{{- end }}
108110
verbs:
109111
- update

conformance/Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ PROVISIONER_MANIFEST=provisioner/provisioner.yaml
1717
ENABLE_EXPERIMENTAL ?= false
1818
.DEFAULT_GOAL := help
1919

20+
ifeq ($(ENABLE_EXPERIMENTAL),true)
21+
SUPPORTED_FEATURES +=,GRPCExactMethodMatching,GRPCRouteListenerHostnameMatching
22+
endif
23+
2024
.PHONY: help
2125
help: Makefile ## Display this help
2226
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "; printf "Usage:\n\n make \033[36m<target>\033[0m\n\nTargets:\n\n"}; {printf " \033[36m%-30s\033[0m %s\n", $$1, $$2}'

deploy/manifests/nginx-gateway-experimental.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ rules:
7777
- httproutes
7878
- referencegrants
7979
- backendtlspolicies
80+
- grpcroutes
8081
verbs:
8182
- list
8283
- watch
@@ -87,6 +88,7 @@ rules:
8788
- gateways/status
8889
- gatewayclasses/status
8990
- backendtlspolicies/status
91+
- grpcroutes/status
9092
verbs:
9193
- update
9294
- apiGroups:

deploy/manifests/nginx-plus-gateway-experimental.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ rules:
8383
- httproutes
8484
- referencegrants
8585
- backendtlspolicies
86+
- grpcroutes
8687
verbs:
8788
- list
8889
- watch
@@ -93,6 +94,7 @@ rules:
9394
- gateways/status
9495
- gatewayclasses/status
9596
- backendtlspolicies/status
97+
- grpcroutes/status
9698
verbs:
9799
- update
98100
- apiGroups:

go.mod

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,17 +37,17 @@ require (
3737
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
3838
github.com/cespare/xxhash/v2 v2.2.0 // indirect
3939
github.com/davecgh/go-spew v1.1.1 // indirect
40-
github.com/emicklei/go-restful/v3 v3.11.0 // indirect
40+
github.com/emicklei/go-restful/v3 v3.11.2 // indirect
4141
github.com/evanphx/json-patch v5.7.0+incompatible // indirect
4242
github.com/evanphx/json-patch/v5 v5.9.0 // indirect
4343
github.com/fatih/color v1.16.0 // indirect
4444
github.com/fsnotify/fsnotify v1.7.0 // indirect
4545
github.com/go-logfmt/logfmt v0.5.1 // indirect
4646
github.com/go-logr/stdr v1.2.2 // indirect
4747
github.com/go-logr/zapr v1.3.0 // indirect
48-
github.com/go-openapi/jsonpointer v0.20.0 // indirect
49-
github.com/go-openapi/jsonreference v0.20.2 // indirect
50-
github.com/go-openapi/swag v0.22.4 // indirect
48+
github.com/go-openapi/jsonpointer v0.20.2 // indirect
49+
github.com/go-openapi/jsonreference v0.20.4 // indirect
50+
github.com/go-openapi/swag v0.22.7 // indirect
5151
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect
5252
github.com/gobuffalo/flect v1.0.2 // indirect
5353
github.com/gogo/protobuf v1.3.2 // indirect

go.sum

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,11 @@ github.com/chzyer/logex v1.2.0/go.mod h1:9+9sk7u7pGNWYMkh0hdiL++6OeibzJccyQU4p4M
1010
github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI=
1111
github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU=
1212
github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
13-
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
1413
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
1514
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
1615
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
17-
github.com/emicklei/go-restful/v3 v3.11.0 h1:rAQeMHw1c7zTmncogyy8VvRZwtkmkZ4FxERmMY4rD+g=
18-
github.com/emicklei/go-restful/v3 v3.11.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc=
16+
github.com/emicklei/go-restful/v3 v3.11.2 h1:1onLa9DcsMYO9P+CXaL0dStDqQ2EHHXLiz+BtnqkLAU=
17+
github.com/emicklei/go-restful/v3 v3.11.2/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc=
1918
github.com/evanphx/json-patch v5.7.0+incompatible h1:vgGkfT/9f8zE6tvSCe74nfpAVDQ2tG6yudJd8LBksgI=
2019
github.com/evanphx/json-patch v5.7.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk=
2120
github.com/evanphx/json-patch/v5 v5.9.0 h1:kcBlZQbplgElYIlo/n1hJbls2z/1awpXxpRi0/FOJfg=
@@ -35,14 +34,12 @@ github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
3534
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
3635
github.com/go-logr/zapr v1.3.0 h1:XGdV8XW8zdwFiwOA2Dryh1gj2KRQyOOoNmBy4EplIcQ=
3736
github.com/go-logr/zapr v1.3.0/go.mod h1:YKepepNBd1u/oyhd/yQmtjVXmm9uML4IXUgMOwR8/Gg=
38-
github.com/go-openapi/jsonpointer v0.19.6/go.mod h1:osyAmYz/mB/C3I+WsTTSgw1ONzaLJoLCyoi6/zppojs=
39-
github.com/go-openapi/jsonpointer v0.20.0 h1:ESKJdU9ASRfaPNOPRx12IUyA1vn3R9GiE3KYD14BXdQ=
40-
github.com/go-openapi/jsonpointer v0.20.0/go.mod h1:6PGzBjjIIumbLYysB73Klnms1mwnU4G3YHOECG3CedA=
41-
github.com/go-openapi/jsonreference v0.20.2 h1:3sVjiK66+uXK/6oQ8xgcRKcFgQ5KXa2KvnJRumpMGbE=
42-
github.com/go-openapi/jsonreference v0.20.2/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En5Ap4rVB5KVcIDZG2k=
43-
github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14=
44-
github.com/go-openapi/swag v0.22.4 h1:QLMzNJnMGPRNDCbySlcj1x01tzU8/9LTTL9hZZZogBU=
45-
github.com/go-openapi/swag v0.22.4/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14=
37+
github.com/go-openapi/jsonpointer v0.20.2 h1:mQc3nmndL8ZBzStEo3JYF8wzmeWffDH4VbXz58sAx6Q=
38+
github.com/go-openapi/jsonpointer v0.20.2/go.mod h1:bHen+N0u1KEO3YlmqOjTT9Adn1RfD91Ar825/PuiRVs=
39+
github.com/go-openapi/jsonreference v0.20.4 h1:bKlDxQxQJgwpUSgOENiMPzCTBVuc7vTdXSSgNeAhojU=
40+
github.com/go-openapi/jsonreference v0.20.4/go.mod h1:5pZJyJP2MnYCpoeoMAql78cCHauHj0V9Lhc506VOpw4=
41+
github.com/go-openapi/swag v0.22.7 h1:JWrc1uc/P9cSomxfnsFSVWoE1FW6bNbrVPmpQYpCcR8=
42+
github.com/go-openapi/swag v0.22.7/go.mod h1:Gl91UqO+btAM0plGGxHqJcQZ1ZTy6jbmridBTsDy8A0=
4643
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI=
4744
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls=
4845
github.com/gobuffalo/flect v1.0.2 h1:eqjPGSo2WmjgY2XlpGwo2NXgL3RucAKo4k4qQMNA5sA=
@@ -84,11 +81,8 @@ github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnr
8481
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
8582
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
8683
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
87-
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
8884
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
8985
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
90-
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
91-
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
9286
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
9387
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
9488
github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0=
@@ -137,8 +131,8 @@ github.com/prometheus/common v0.53.0 h1:U2pL9w9nmJwJDa4qqLQ3ZaePJ6ZTwt7cMD3AG3+a
137131
github.com/prometheus/common v0.53.0/go.mod h1:BrxBKv3FWBIGXw89Mg1AeBq7FSyRzXWI3l3e7W3RN5U=
138132
github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo=
139133
github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo=
140-
github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ=
141-
github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog=
134+
github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M=
135+
github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA=
142136
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
143137
github.com/sclevine/spec v1.4.0 h1:z/Q9idDcay5m5irkZ28M7PtQM4aOISzOpj4bUPkDee8=
144138
github.com/sclevine/spec v1.4.0/go.mod h1:LvpgJaFyvQzRvc1kaDs0bulYwzC70PbiYjC4QnFHkOM=

internal/framework/gatewayclass/validate.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ var gatewayCRDs = map[string]apiVersion{
2222
"httproutes.gateway.networking.k8s.io": {},
2323
"referencegrants.gateway.networking.k8s.io": {},
2424
"backendtlspolicies.gateway.networking.k8s.io": {},
25+
"grpcroutes.gateway.networking.k8s.io": {},
2526
}
2627

2728
type apiVersion struct {

internal/mode/static/handler.go

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -245,12 +245,23 @@ func (h *eventHandlerImpl) updateStatuses(ctx context.Context, logger logr.Logge
245245
if h.cfg.updateGatewayClassStatus {
246246
gcReqs = status.PrepareGatewayClassRequests(graph.GatewayClass, graph.IgnoredGatewayClasses, transitionTime)
247247
}
248-
routeReqs := status.PrepareRouteRequests(graph.Routes, transitionTime, h.latestReloadResult, h.cfg.gatewayCtlrName)
248+
hrReqs := status.PrepareHTTPRouteRequests(
249+
graph.HTTPRoutes,
250+
transitionTime,
251+
h.latestReloadResult,
252+
h.cfg.gatewayCtlrName,
253+
)
254+
grReqs := status.PrepareGRPCRouteRequests(
255+
graph.GRPCRoutes, transitionTime,
256+
h.latestReloadResult,
257+
h.cfg.gatewayCtlrName,
258+
)
249259
polReqs := status.PrepareBackendTLSPolicyRequests(graph.BackendTLSPolicies, transitionTime, h.cfg.gatewayCtlrName)
250260

251-
reqs := make([]frameworkStatus.UpdateRequest, 0, len(gcReqs)+len(routeReqs)+len(polReqs))
261+
reqs := make([]frameworkStatus.UpdateRequest, 0, len(gcReqs)+len(hrReqs)+len(grReqs)+len(polReqs))
252262
reqs = append(reqs, gcReqs...)
253-
reqs = append(reqs, routeReqs...)
263+
reqs = append(reqs, hrReqs...)
264+
reqs = append(reqs, grReqs...)
254265
reqs = append(reqs, polReqs...)
255266

256267
h.cfg.statusUpdater.UpdateGroup(ctx, groupAllExceptGateways, reqs...)

internal/mode/static/manager.go

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ func registerControllers(
417417
}
418418

419419
if cfg.ExperimentalFeatures {
420-
backendTLSObjs := []ctlrCfg{
420+
gwExpFeatures := []ctlrCfg{
421421
{
422422
objectType: &gatewayv1alpha2.BackendTLSPolicy{},
423423
options: []controller.Option{
@@ -429,8 +429,14 @@ func registerControllers(
429429
// https://github.com/nginxinc/nginx-gateway-fabric/issues/1545
430430
objectType: &apiv1.ConfigMap{},
431431
},
432+
{
433+
objectType: &gatewayv1alpha2.GRPCRoute{},
434+
options: []controller.Option{
435+
controller.WithK8sPredicate(k8spredicate.GenerationChangedPredicate{}),
436+
},
437+
},
432438
}
433-
controllerRegCfgs = append(controllerRegCfgs, backendTLSObjs...)
439+
controllerRegCfgs = append(controllerRegCfgs, gwExpFeatures...)
434440
}
435441

436442
if cfg.ConfigName != "" {
@@ -596,7 +602,12 @@ func prepareFirstEventBatchPreparerArgs(
596602
}
597603

598604
if enableExperimentalFeatures {
599-
objectLists = append(objectLists, &gatewayv1alpha2.BackendTLSPolicyList{}, &apiv1.ConfigMapList{})
605+
objectLists = append(
606+
objectLists,
607+
&gatewayv1alpha2.BackendTLSPolicyList{},
608+
&apiv1.ConfigMapList{},
609+
&gatewayv1alpha2.GRPCRouteList{},
610+
)
600611
}
601612

602613
if gwNsName == nil {

internal/mode/static/manager_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ func TestPrepareFirstEventBatchPreparerArgs(t *testing.T) {
9595
&gatewayv1beta1.ReferenceGrantList{},
9696
partialObjectMetadataList,
9797
&gatewayv1alpha2.BackendTLSPolicyList{},
98+
&gatewayv1alpha2.GRPCRouteList{},
9899
},
99100
experimentalEnabled: true,
100101
},

internal/mode/static/nginx/conf/nginx-plus.conf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ http {
2626
sendfile on;
2727
tcp_nopush on;
2828

29+
http2 on;
30+
2931
server {
3032
listen 127.0.0.1:8765;
3133
root /usr/share/nginx/html;

internal/mode/static/nginx/conf/nginx.conf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ http {
2626
sendfile on;
2727
tcp_nopush on;
2828

29+
http2 on;
30+
2931
server {
3032
listen unix:/var/run/nginx/nginx-status.sock;
3133
access_log off;

internal/mode/static/nginx/config/http/config.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ type Server struct {
77
Locations []Location
88
IsDefaultHTTP bool
99
IsDefaultSSL bool
10+
HTTP2 bool
1011
Port int32
1112
}
1213

@@ -19,9 +20,10 @@ type Location struct {
1920
HTTPMatchVar string
2021
Rewrites []string
2122
ProxySetHeaders []Header
23+
IsGRPC bool
2224
}
2325

24-
// Header defines a HTTP header to be passed to the proxied server.
26+
// Header defines an HTTP header to be passed to the proxied server.
2527
type Header struct {
2628
Name string
2729
Value string

0 commit comments

Comments
 (0)