Serve static files in no time with NGINX and Docker

jvm-lukas.com 1 rok temu

What is NGINX?

Initially it was just a webserver. Nowadays, it is often used as a reverse proxy, load balancer, and HTTP cache, static files server and more.

Serving static files

with docker, it is super simple. Just run:

docker run -it --rm -d -p 8080:80 nginx:1.23.3

and example index.html is served on localhost:8080.

Let’s look into it

docker exec -it CONTAINER_ID bash

example file is served in ./usr/share/nginx/html/index.html.

find . | grep index.html

and nginx config is in...

Idź do oryginalnego materiału