Python based put-docker-data-into-text-template project.
217
auto_proxy Environment VariablesUse environment variables to configure the auto_proxy container.
SIGNALSNote: Any containers with the
auto_proxy.signallabel will be automatically added to this list, with the correct container id. Therefore you should prefer setting theauto_proxy.signallabel on a specific container over using this. This is intended only for containers where you somehow can't set the labels.
On creation of a new config file it can send signals to other containers, to e.g. reload configuration files.
Provide key-value like container=signal.
container can be either the name or the id of the container.signal can be either the case insensitive signal name, or it's number.If you want to send multiple signals make a comma separated list.
For example:
SIGNALS=nginx=sighup,nginx=1,nginx=SIGHUB
This would send SIGHUP 3 times to the nginx container.
On supported labels you can insert environment variables of that container.
Syntax is §{VAR_NAME}.
auto_proxy.signalYou don't need to set
auto_proxy.enablefor this to work.
This container will be send an signal in case of a change in configuration. Can be the signal number or the case insensitive name. Also a comma separated list of multiple signals to send is possible.
Example: auto_proxy.signal: SIGHUP,1,sighup would have it send the SIGHUP signal 3 times.
Note: This label don't support environment variables.
auto_proxy.enableMust be set to 1 to let it be picked up by auto_proxy for generating a config.
Note: This label don't support environment variables.
auto_proxy.hostHostname where to serve it from.
E.g. example.com,www.example.com
auto_proxy.accessnet: Use normal port based proxy (default)socket: Use file based socketauto_proxy.protocolhttp: Just proxy it through. (default)uwsgi: Use the uwsgi protocol instead.auto_proxy.portUsed only if
auto_proxy.access = net.
Set an port on the container to use.
Default: 80
auto_proxy.mount_pointSet a mount point on the host.
Default: /service_name_short,
Where service_name_short is the name of the container,
or just the service name in case of docker compose.
auto_proxy.bufferIf we want to buffer the response before sending.
Set to 1 to enable, 0 to disable.
Default: 1
Like the nginx default.
auto_proxy.enforce_httpsIf we encounter a connection with http, should we redirect to https://$server_name$request_uri?
0: off. Don't perform any checks. https stays https, http keeps being http.client: The scheme of the client directly connected.proxy: We are behind another proxy (e.g. cloudflare), and we want to look into the X-Forwarded-Proto header. Enable only if you trust that proxy to set the header correctly.1: Default. Basically an "auto" mode trying proxy and client. If there is a X-Forwarded-Proto header, use that, else use the connection's scheme. Note, if you are not behind a proxy, clients could set that header.auto_proxy.socket_nameUsed only if
auto_proxy.access = socket.
Custom socket file name.
Default: service_name_short.sock,
Where service_name_short is the name of the container,
or just the service name in case of docker compose.
auto_proxy.container_pathSet an path in the container to use.
Default: / (root)
auto_proxy.directives.nginx.*Allows to set specific nginx directives for this container.
For example auto_proxy.directives.nginx.client_max_body_size: "2M" would increase the nginx's upload size to 2 MB for that route.
If you specify auto_proxy.directives.nginx without .<suffix>, you can provide a json encoded dictionary, e.g. "{\"client_max_body_size\": \"2M\"}".
Any auto_proxy.directives.nginx.* key will add/overwrite values to this array. Default is an empty array "{}".
docker-compose.ymlHaving something like
version: "2.3" # probably newer is fine too.
volumes:
auto_proxy:
external: false
driver: local
services:
auto_proxy:
restart: 'always'
image: luckydonald/auto_proxy
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- auto_proxy:/output/
proxy:
restart: 'always'
image: nginx
ports:
- "80:80"
- "443:443"
volumes:
- auto_proxy:/etc/nginx/conf.d/
labels:
auto_proxy.signal: SIGHUP
app:
# ...
image: 'jwilder/whoami' # for example
# ...
environment:
URL_PATH: "service"
API_VERSION: "v1"
URL_HOSTNAME: "example.com"
labels:
auto_proxy.enable: "1"
auto_proxy.host: "§{URL_HOSTNAME}"
auto_proxy.mount_point: "/§{URL_PATH}/%{API_VERSION}/"
auto_proxy.access: socket
auto_proxy.directives.nginx.client_max_body_size: 2M
Would result in ´app´ having the values
auto_proxy.enable: 1 - Will be configuredauto_proxy.host: example.com - Specifies server blockauto_proxy.mount_point: /service/v1/ - So when you open "example.com/service/v1/"auto_proxy.access: socketauto_proxy.directives: { "nginx": { "client_max_body_size": "2M" } } - only this service will have a bigger upload size.And the proxy container getting a SIGHUP signal
after any configuration change.
Content type
Image
Digest
Size
343.1 MB
Last updated
over 7 years ago
docker pull luckydonald/auto_proxy