nginx with lua
Allows use of environment variables in config files.
env OTHER-CONTAINER_PORT_8080_TCP_ADDR;
# Snip
http {
# Snip
server {
# The IP that you forwarded in your router (nginx proxy)
listen 80;
listen [::]:80;
server_name example.com;
resolver 8.8.8.8;
# Get the IP of the linked Docker Container
set_by_lua $upstreamip 'return os.getenv("OTHER-CONTAINER_PORT_8080_TCP_ADDR")';
set $upstream "http://${upstreamip}:8080";
location / {
proxy_pass_header Authorization;
proxy_pass $upstream;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_http_version 1.1;
proxy_set_header Connection "";
proxy_buffering off;
client_max_body_size 0;
proxy_read_timeout 36000s;
proxy_redirect off;
}
}
}
Content type
Image
Digest
Size
3.2 MB
Last updated
over 8 years ago
docker pull really/nginx-lua