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

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.

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



Arulraj V



Arul



Follow @arulrajnet on X


GitHub @arulrajnet


LinkedIn @arulrajnet