-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs: elaborate on X-Forwarded-For header #314
Open
joshua-mo-143
wants to merge
2
commits into
shuttle-hq:main
Choose a base branch
from
joshua-mo-143:refactor/forwarded-for-elaboration
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,7 @@ icon: "box" | |
Deployments run in AWS ECS with Fargate VMs. | ||
The default compute configuration is 0.25 vCPU and 0.5 GB RAM. | ||
This will soon be made configurable. | ||
If you need more compute out of the gate, reach out to us. | ||
If you need more compute out of the gate, [reach out to us.](https://www.shuttle.dev/contact) | ||
|
||
**Rolling deployments**: | ||
When a new deployment is made, it will be started alongside the previous one until it is considered healthy. | ||
|
@@ -23,7 +23,12 @@ If the new deployment fails to become healthy, it will be retried 3 times while | |
|
||
HTTPS traffic is proxied to your app on the project's default subdomain and any [custom domains]() that have been added. | ||
|
||
The proxy sets the `X-Forwarded-For` HTTP header on incoming requests to the remote IP address of the request. | ||
### Request Headers | ||
|
||
#### X-Forwarded-For | ||
`X-Forwarded-For` is a header that allows you to get the original IP of the HTTP request. Deployed Shuttle projects sit behind a proxy, meaning that when you try to get the IP address normally you may end up with the proxy IP instead of the requester IP. With the `X-Forwarded-For` header, you can now always get the requester IP by parsing the given header value. | ||
|
||
To implement your own custom rate limiting, our [blog post on how to write API rate limiting yourself](https://www.shuttle.dev/blog/2024/02/22/api-rate-limiting-rust) may prove useful. You can also additionally implement your own middleware that utilises the `governor` crate, as seen on [`tower-governor`](https://docs.rs/tower_governor/latest/tower_governor/) and [`actix-governor`](https://docs.rs/actix-governor/latest/actix_governor/). | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure if this is the right place to link to rate limiting guides, as it's not the only use-case. I feel it would be more appropriate to link to the documentation for this header in the rate limiting guides themselves. |
||
|
||
## Environment variables | ||
|
||
|
@@ -44,4 +49,3 @@ See [Shuttle Secrets](/resources/shuttle-secrets) | |
## Customize Runtime container | ||
|
||
See [Hook scripts](/docs/builds#experimental-hook-scripts) | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we make it a bit more concise, perhaps like this?
We are also using the header incorrectly, it should be a comma separated list of IPs, including the IP of our proxy. If it's just the original client IP, we should have a new custom header, as I understand it. But we can address that later.