Add custom backend annotation
This commit is contained in:
parent
3499524282
commit
bf12e793f6
10 changed files with 270 additions and 17 deletions
|
|
@ -50,6 +50,7 @@ The following annotations are supported:
|
|||
|[ingress.kubernetes.io/base-url-scheme](#rewrite)|string|
|
||||
|[ingress.kubernetes.io/client-body-buffer-size](#client-body-buffer-size)|string|
|
||||
|[ingress.kubernetes.io/configuration-snippet](#configuration-snippet)|string|
|
||||
|[ingress.kubernetes.io/default-backend](#default-backend)|string|
|
||||
|[ingress.kubernetes.io/enable-cors](#enable-cors)|true or false|
|
||||
|[ingress.kubernetes.io/force-ssl-redirect](#server-side-https-enforcement-through-redirect)|true or false|
|
||||
|[ingress.kubernetes.io/from-to-www-redirect](#redirect-from-to-www)|true or false|
|
||||
|
|
@ -158,6 +159,10 @@ Using this annotation you can add additional configuration to the NGINX location
|
|||
ingress.kubernetes.io/configuration-snippet: |
|
||||
more_set_headers "Request-Id: $request_id";
|
||||
```
|
||||
### Default Backend
|
||||
|
||||
The ingress controller requires a default backend. This service is handle the response when the service in the Ingress rule does not have endpoints.
|
||||
This is a global configuration for the ingress controller. In some cases could be required to return a custom content or format. In this scenario we can use the annotation `ingress.kubernetes.io/default-backend: <svc name>` to specify a custom default backend.
|
||||
|
||||
### Enable CORS
|
||||
|
||||
|
|
|
|||
|
|
@ -405,7 +405,8 @@ http {
|
|||
fastcgi_param HTTP_X_Endpoints {{ .DefaultBackendEndpoints }};
|
||||
fastcgi_pass unix:/var/run/go-fastcgi.sock;
|
||||
{{ else }}
|
||||
return 404;
|
||||
set $proxy_upstream_name "upstream-default-backend";
|
||||
proxy_pass http://upstream-default-backend;
|
||||
{{ end }}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue