An open API service indexing awesome lists of open source software.

https://github.com/creekorful/direktion

Very-simple & idiomatic URL forwarder.
https://github.com/creekorful/direktion

golang http-server redirections redirects url-forwarding

Last synced: 3 months ago
JSON representation

Very-simple & idiomatic URL forwarder.

Awesome Lists containing this project

README

        

# direktion

Very-simple & idiomatic HTTP URL rewriter.

## How to use it?

Create a `direktion.json` config file where you want, with your redirections:

```json
{
"redirects": {
"example.com/blog": {
"location": "https://blog.example.org/$request_uri",
"code": 307
},
"example.com": {
"location": "https://example.org",
"code": 307
},
"www.example.com": {
"location": "https://example.org",
"code": 308
}
},
"use_x_forwarded": false
}
```

and then execute direktion: `./direktion --config `

nb: if `use_x_forwarded` is true, then direktion will use the `X-Forwarded*` headers to determinate remote IP address. (
should only enabled if behind trusted reverse proxy)