website: Copy files during build. website: Allow for mixed env builds. website: Reduce build size. website: Expose build. website: Add build memory debugging. WIP: Disable broken links check to compare memory usage. website: Update deps. website: Clean up API paths. website: Flesh out 3.8 fixes. Format. website: Update ignore paths. Website: Clean up integrations build. website: Fix paths. website: Optimize remark. website: Update deps. website: Format. website: Remove linking. website: Fix paths. wip: Attempt API only build. Prep. Migrate render to runtime. Tidy sidebar. Clean up templates. docs: Move directory. WIP docs: Flesh out split. website: Fix issue where routes have collisions.
42 lines
1.1 KiB
Markdown
42 lines
1.1 KiB
Markdown
---
|
|
title: Custom headers
|
|
---
|
|
|
|
The proxy can send custom headers to your upstream application. These can be configured in one of two ways:
|
|
|
|
- Group attributes; this allows for inheritance, but only allows static values
|
|
- Property mappings; this allows for dynamic values
|
|
|
|
## Group attributes
|
|
|
|
Edit the group or user you wish the header to be set for, and set these attributes:
|
|
|
|
```yaml
|
|
additionalHeaders:
|
|
X-My-Header: value
|
|
```
|
|
|
|
You can the add users to this group or override the field in users.
|
|
|
|
## Property Mappings
|
|
|
|
For dynamic Header values (for example, your application requires X-App-User to contain the username), property mappings can be used.
|
|
|
|
Create a new Scope mapping with a name and scope of your choice, and use an expression like this:
|
|
|
|
```python
|
|
return {
|
|
"ak_proxy": {
|
|
"user_attributes": {
|
|
"additionalHeaders": {
|
|
"X-App-User": request.user.username
|
|
}
|
|
}
|
|
}
|
|
}
|
|
```
|
|
|
|
After you've created this Scope mapping, make sure to edit the proxy provider and select the mapping.
|
|
|
|
As you can see by the similar structure, this just overrides any static attributes, so both of these methods can be combined.
|