package documentation
Reverse proxy helper functions
All the functions in this module are meant to be used by the reverse proxy api and migration script. Be careful when using them in other contexts.
From __init__.py
:
Function | add |
Add a new server to the nginx config. |
Function | add |
Add a new location to the _lan server. |
Function | certificate |
List all the certificates in the system. |
Function | create |
Create a new location in the nginx config. |
Function | set |
Set the proxy pass for the specified location. This function is a mere workaround for nginx to allow non-resolvable domains to be used as proxy_pass. |
Add a new server to the nginx config.
- Args:
- domain: domain to answer to
- destination: where to proxy the request to
- certificate: certificate to be used, beware the certificate must be in the list of certificates
- description: easy description of the server
- allow: ip addresses allowed to access the server
Add a new location to the _lan server.
- Args:
- path: path where the location will answer
- destination: destination endpoint
- description: description of the location
- allow: array of allowed ip addresses
Create a new location in the nginx config.
- Args:
- e_uci: EUci object
- uci_server: where the location is defined
- location: path where the location will answer
- proxy_pass: where the location will proxy to
- domain: optional domain to set in the Host header
- allow: array of allowed ip addresses
- Returns:
- location id of the created location