Browse Source

add dynamic reverse proxy

master
Markus Bergholz 4 years ago
parent
commit
9152b270fd
  1. 23
      til.md

23
til.md

@ -242,4 +242,27 @@ RUN mkdir /run/nginx
EXPOSE 80
CMD nginx -g 'daemon off;'
```
nginx dynamic reverse proxy for docker swarm mode
```
events {
worker_connections 1024;
}
http {
server {
resolver 127.0.0.11;
location ~ /(.*) {
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
set $upstream $1;
proxy_pass http://$upstream;
}
}
}
```
Loading…
Cancel
Save