Simple Docker Setup for serving static files and proxy pass a path to a server
Just click "Download ZIP" oder "Embed -> Clone" and then run docker-compose up
.
The server is available on http://localhost:8080 and will serve the files in ./static
Simple Docker Setup for serving static files and proxy pass a path to a server
Just click "Download ZIP" oder "Embed -> Clone" and then run docker-compose up
.
The server is available on http://localhost:8080 and will serve the files in ./static
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; | |
} | |
} |