Skip to content

Instantly share code, notes, and snippets.

@Lua12138
Created March 22, 2022 07:40
Show Gist options
  • Save Lua12138/001e97f1098a78e667994fca84b6fd91 to your computer and use it in GitHub Desktop.
Save Lua12138/001e97f1098a78e667994fca84b6fd91 to your computer and use it in GitHub Desktop.
Nginx in docker with templates
version: "3"
services:
nginx:
image: nginx:1.21.6-alpine
environment:
- NGINX_ORDER_HOST=sample.com
- NGINX_ORDER_BACKEND=http://sample:8080
volumes:
- "./nginx/templates:/etc/nginx/templates:ro"
ports:
- 80:80
- 443:443
# Sample of the template file.
# the filename must be end of .conf.template
#server {
# listen 80;
# server_name ${NGINX_ORDER_HOST};
# location / {
# proxy_pass ${NGINX_ORDER_BACKEND};
# proxy_set_header X-Real-IP $remote_addr;
# proxy_redirect off;
# proxy_http_version 1.1;
# proxy_buffering off;
# }
#}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment