Skip to navigation
Proxypass an internal python api server from my docker nginx config
15.01.20
docker-compose.yml version: '3' services: s_http: image: nginx container_name: s_http network_mode: "host" volumes: - ../public:/usr/share/nginx/html/ - ./etc/nginx/certs:/etc/nginx/certs - ./etc/nginx/conf.d:/etc/nginx/conf.d ports: - "80:80" - "443:443" environment: - NGINX_HOST=sal.dev - NGINX_PORT=80 default.conf: server { listen 80; server_name localhost; location ~ ^/api/(.*)$ { proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_pass http://127.0.0.1:8081/$1; } location / { root /usr/share/nginx/html; index index.html index.htm; } error_page 500 502 503 504 /50x.html; location = /50x.html { root /usr/share/nginx/html; } }
https://www.liaohuqiu.net/posts/nginx-proxy-pass/
Reply
Anonymous
Information Epoch 1732610307
Development is an iterative process.
Home
Notebook
Contact us