Nginx container reverse proxy with latest nginx image
spec
- exposed http port
- single domain proxy
- http header pass
how to use
-
open nginx configuration to ./conf.d/default.conf
-
Add this line of conf to set directory and proxy passing
location / { proxy_pass http://{{ IP/Domain target }}/; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; }
-
Adjust directory and domain target to use proxy
-
Run this project with docker compose
docker compose up -d
-
Test with this link
http://localhost/