Skip to content

Commit 558d1aa

Browse files
feat(serverless): add note on http redirection for containers (#4022)
* feat(serverless): add note on http redirection * docs(srv): review and update doc on HTTPS redirection --------- Co-authored-by: SamyOubouaziz <[email protected]>
1 parent 908ab49 commit 558d1aa

File tree

1 file changed

+18
-4
lines changed

1 file changed

+18
-4
lines changed

serverless/containers/how-to/secure-a-container.mdx

+18-4
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Instead of using environment variables (which are stored in clear text) for your
3131
### Configure secrets from the Scaleway console
3232

3333
1. Click **Containers** in the **Serverless** section of the side menu. The containers page displays.
34-
2. Click the relevant container namespace.
34+
2. Click the relevant Containers namespace.
3535
3. Click the name of the container for which you want to define secrets.
3636
4. Click the **Deployment** tab.
3737
5. Scroll to the **Secrets** section of the page and click **Add secret**. Enter the key and value for your secret. Repeat for additional secrets.
@@ -94,11 +94,25 @@ curl -H "X-Auth-Token: <YOUR_CONTAINER_TOKEN>" <YOUR_CONTAINER_ENDPOINT>
9494

9595
Refer to the [How to create an authentication token](/serverless/containers/how-to/create-auth-token-from-console/) documentation for more information.
9696

97-
### Restrict access using Terraform
97+
## Redirect HTTP to HTTPS
98+
99+
If you do not want to expose your container over HTTP, you can enable the HTTP to HTTPS redirection to ensure that all traffic follows a secure path.
100+
101+
### Configure redirection using the Scaleway console
102+
103+
1. Click **Containers** in the **Serverless** section of the side menu of the Scaleway console. The Containers page displays.
104+
2. Click the relevant Containers namespace.
105+
3. Click the name of the container for which you want to enable the redirection.
106+
4. Click the **Security** tab.
107+
5. Toggle the **HTTPS connections only** switch to **On**.
108+
109+
Incoming HTTP traffic is now redirected to HTTPS.
110+
111+
### Configure redirection using the Serverless framework
98112

99-
Set `privacy = "private"` in your Terraform [resource description](https://registry.terraform.io/providers/scaleway/scaleway/latest/docs/resources/container).
113+
To redirect HTTP traffic to HTTPS using the Serverless Framework, add the `httpOption: redirected` option to your container's description.
100114

101-
You can generate access credentials to inject in other applications, such as containers and functions, directly from Terraform using the [container_token resource](https://registry.terraform.io/providers/scaleway/scaleway/latest/docs/resources/container_token).
115+
Refer to our [dedicated repository](https://github.com/scaleway/serverless-scaleway-functions/?tab=readme-ov-file#container-specific-configuration) for more information on container configuration using the Serverless Framework.
102116

103117
## Set up alerts in Observability Cockpit (upcoming feature)
104118

0 commit comments

Comments
 (0)