Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ko1103/simple-redirect
Simple Container to Redirect all Request to Another URL.
https://github.com/ko1103/simple-redirect
docker golang redirect simple
Last synced: about 1 month ago
JSON representation
Simple Container to Redirect all Request to Another URL.
- Host: GitHub
- URL: https://github.com/ko1103/simple-redirect
- Owner: Ko1103
- Created: 2024-04-08T10:48:38.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2024-04-11T07:49:57.000Z (9 months ago)
- Last Synced: 2024-04-11T12:45:31.176Z (9 months ago)
- Topics: docker, golang, redirect, simple
- Language: Go
- Homepage:
- Size: 7.81 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Simple Redirect Container
Simple container for redirect all request but health check path to specific url.
## Get started
You can run by docker-compose.
```shell
docker compose up -d
```and access to `http://localhost:8080` you will be redirected to `https://www.google.com`
When you access to `http://localhost:8080/health` you will get `200 OK` response.
## Run in k8s
You can use this as pod in k8s.
full example is [here](https://github.com/Ko1103/simple-redirect/blob/main/example/k8s/deploy.yaml)
3 steps to run in k8s:
1. Set container: `michealko/simple-redirect:latest`
2. Set envoriment variable `REDIRECT_URL`. e.g. `https://www.google.com`.
3. Set health check path. e.g. `/health`# Troubleshooting
If ingress health check is failed, it may be caused by service health check path. Please check the health check path in your ingress configuration.
For example, if you use GCP, use BackendConfig to set health check path.
```yaml
apiVersion: cloud.google.com/v1
kind: BackendConfig
metadata:
name: simple-redirect-backendconfig
spec:
healthCheck:
requestPath: /health
```