https://github.com/arulrajnet/apisix-route-host-regex
This is a simple example of how to create a route in APISix based on a regex in the host.
https://github.com/arulrajnet/apisix-route-host-regex
apisix docker-compose
Last synced: 3 months ago
JSON representation
This is a simple example of how to create a route in APISix based on a regex in the host.
- Host: GitHub
- URL: https://github.com/arulrajnet/apisix-route-host-regex
- Owner: arulrajnet
- License: mit
- Created: 2025-03-08T13:40:15.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2025-05-12T06:52:22.000Z (5 months ago)
- Last Synced: 2025-05-12T07:42:13.179Z (5 months ago)
- Topics: apisix, docker-compose
- Homepage:
- Size: 4.88 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
APISix Route Based on Regex in Host
===============================
This is a simple example of how to create a route in APISix based on a regex in the host.## Requirements
- Docker
- Docker Compose## Setup
* Clone this repository
* Run the following command in the root directory of the project:
```bash
docker-compose up -d
```## Testing
Test using curl with the host header
```bash
curl -v -H "Host: pihole-device.local.arulraj.net" http://localhost:9080 | grep -i "I am a Device!"
curl -v -H "Host: customer.local.arulraj.net" http://localhost:9080 | grep -i "This is Customer Home."
curl -v -H "Host: local.arulraj.net" http://localhost:9080 | grep -i "This is Customer Home."
```## Cleanup
To stop the containers, run the following command:
```bash
docker-compose down
```## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
## Author