Skip to content

Instantly share code, notes, and snippets.

@Fijo
Last active June 8, 2024 14:39
Show Gist options
  • Save Fijo/5a0dcfe840d53437f46f405ca5333cc9 to your computer and use it in GitHub Desktop.
Save Fijo/5a0dcfe840d53437f46f405ca5333cc9 to your computer and use it in GitHub Desktop.
docker-nginx-templating-defaults-poc
server {
listen ${NGINX_PORT};
server_name simple-reverse-proxy;
location / {
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_pass ${NGINX_REMOTE_URL};
}
}
version: '3'
services:
website-proxy-default:
build: .
environment:
- NGINX_REMOTE_URL=http://website/
ports:
- 90:80
restart: unless-stopped
networks:
- default
website-proxy-port-91:
build: .
environment:
- NGINX_REMOTE_URL=http://website/
- NGINX_PORT=91
ports:
- 91:91
restart: unless-stopped
networks:
- default
website:
image: nginx:1-alpine
volumes:
- ./index.html:/usr/share/nginx/html/index.html:ro
restart: unless-stopped
networks:
- default
FROM nginx:1-alpine
COPY default.conf.template /etc/nginx/templates/
ENV NGINX_PORT=80
<h1>PoC works!</h1>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment