Last active
June 8, 2024 14:39
-
-
Save Fijo/5a0dcfe840d53437f46f405ca5333cc9 to your computer and use it in GitHub Desktop.
docker-nginx-templating-defaults-poc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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}; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM nginx:1-alpine | |
COPY default.conf.template /etc/nginx/templates/ | |
ENV NGINX_PORT=80 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<h1>PoC works!</h1> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment