Manages redirect rules in haproxy configuration based on subdomain acl.
Project description
# haproxysubdomains
Manages redirect rules in haproxy configuration based on subdomain acl.
Watch out, this will remove any comment in the haproxy config.
Uses [`pyhaproxy`](https://github.com/imjoey/pyhaproxy) under the
hood.
## Usage
```
$ cat test.cfg
```
```
frontend http
bind *:80
frontend https
bind *:443 ssl crt /etc/ssl/my_cert/
default_backend default
backend default
server default 127.0.0.1:8888
```
Add a redirect rule:
```
$ haproxysubdomains add test.cfg https mydomain.com subdomain 5432
$ cat test.cfg
```
```
frontend http
bind *:80
frontend https
bind *:443 ssl crt /etc/ssl/my_cert/
default_backend default
acl subdomain hdr(host) -i subdomain.mydomain.com
use_backend subdomain if subdomain
backend default
server default 127.0.0.1:8888
backend subdomain
server subdomain 127.0.0.1:5432
```
Remove a redirect rule:
```
$ haproxysubdomains del test.cfg https subdomain
```
Manages redirect rules in haproxy configuration based on subdomain acl.
Watch out, this will remove any comment in the haproxy config.
Uses [`pyhaproxy`](https://github.com/imjoey/pyhaproxy) under the
hood.
## Usage
```
$ cat test.cfg
```
```
frontend http
bind *:80
frontend https
bind *:443 ssl crt /etc/ssl/my_cert/
default_backend default
backend default
server default 127.0.0.1:8888
```
Add a redirect rule:
```
$ haproxysubdomains add test.cfg https mydomain.com subdomain 5432
$ cat test.cfg
```
```
frontend http
bind *:80
frontend https
bind *:443 ssl crt /etc/ssl/my_cert/
default_backend default
acl subdomain hdr(host) -i subdomain.mydomain.com
use_backend subdomain if subdomain
backend default
server default 127.0.0.1:8888
backend subdomain
server subdomain 127.0.0.1:5432
```
Remove a redirect rule:
```
$ haproxysubdomains del test.cfg https subdomain
```
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file haproxysubdomains-0.1.0.tar.gz
.
File metadata
- Download URL: haproxysubdomains-0.1.0.tar.gz
- Upload date:
- Size: 2.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 764d829c48967953687a159c446af2d813fd832837ea0bb528c4c638143c6f92 |
|
MD5 | a3b82baff9b21a07800399e82b915cc5 |
|
BLAKE2b-256 | 11601665a8f0b98cc43099af51f1da3339b5ecbad61116697829dc5864a2fb5e |