include documentation about the httpOption annotation (#4273)

* include documentation about the httpOption annotation

* drop trailing whitespace

* pr feedback
This commit is contained in:
Dave Protasowski 2021-09-22 08:28:18 -04:00 committed by GitHub
parent d96c0d8c06
commit 71a8ff5ecb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 25 additions and 0 deletions

View File

@ -72,6 +72,7 @@ nav:
- Configuring custom domains: developer/serving/services/custom-domains.md
- Using a custom TLS certificate for DomainMapping: developer/serving/services/byo-certificate.md
- Configure resource requests and limits: developer/serving/services/configure-requests-limits-services.md
- HTTPS redirection: developer/serving/services/http-option.md
- Traffic management: developer/serving/traffic-management.md
- Configuring gradual rollout of traffic to Revisions: developer/serving/rolling-out-latest-revision.md
- Deploying from private registries: developer/serving/deploying-from-private-registry.md

View File

@ -0,0 +1,24 @@
# HTTPS redirection
Operators can force HTTPS redirection for all Services. See the `httpProtocol` mentioned in the [Turn on AutoTLS](../../../serving/using-auto-tls.md) page for more details.
### Overriding the default HTTP behaviour
You can override the default behavior for each Service by configuring the `networking.knative.dev/httpOption` annotation:
```yaml
apiVersion: serving.knative.dev/v1
kind: Service
metadata:
name: example
namespace: default
annotations:
networking.knative.dev/httpOption: "enabled"
spec:
...
```
The possible values are:
- `enabled` - Services will accept HTTP traffic
- `redirected` - Services send a 301 redirect for all HTTP connections and ask clients to use HTTPS instead