Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
docker nginx static file and proxy pass
Simple Docker Setup for serving static files and proxy pass a path to a server
version: "3.3"
services:
nginx:
build: .
ports:
- 8080:80
volumes:
- ./static:/html:ro
FROM nginx:1.16.1-alpine
COPY nginx.conf /etc/nginx/conf.d/custom.conf
server {
listen 80;
server_name localhost;
root /html;
location /api {
proxy_pass https://example.com/api;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment