https://github.com/caprover/nginx-redirect
A very simple redirector using nginx and Docker
https://github.com/caprover/nginx-redirect
Last synced: 2 months ago
JSON representation
A very simple redirector using nginx and Docker
- Host: GitHub
- URL: https://github.com/caprover/nginx-redirect
- Owner: caprover
- Created: 2020-07-01T12:29:17.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2024-03-31T15:38:52.000Z (about 1 year ago)
- Last Synced: 2025-03-25T08:42:21.415Z (3 months ago)
- Language: Shell
- Homepage:
- Size: 6.84 KB
- Stars: 11
- Watchers: 3
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# nginx-redirect
A very simple redirector using nginx and Docker```
docker run -p 1234:80 --env RETURN_LOCATION='return 301 https://caprover.com$request_uri;' caprover/nginx-redirect
```Open `http://localhost:1234` in your browser.
This is available as a CapRover one click app. It's useful when you want to create domain aliases. For example you want all traffic from `http(s)://www.example.com` to be redirected to `https://example.com`. In this case:
- Create an "Nginx Redirect" one click app and enter `https://example.com` as your redirect URL.
- Once the app is deployed, go to your panel and connect `www.example.com` to this app.
- You can connect more domains if you want to, such as `www2.example.com` and etc.
- Enable HTTPS for any (or all) of these added domains if needed.
- You are done! Now navigating to any of these connected addresses should redirect the user to `https://example.com`
- You can connect `example.com` to your actual app.