@alexie
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
version: '3' services: app1: image: your_app1_image ports: - "8001:8001" app2: image: your_app2_image ports: - "8002:8002" app3: image: your_app3_image ports: - "8003:8003" |
docker-compose up -d
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
server { listen 80; location /app1 { proxy_pass http://app1:8001; } location /app2 { proxy_pass http://app2:8002; } location /app3 { proxy_pass http://app3:8003; } } |
systemctl restart nginx
Теперь вы сможете обращаться к вашим приложениям через Nginx по URL-адресам вида http://ваш-сервер/app1, http://ваш-сервер/app2 и т. д.