Nginx in Docker

Updated: 05 April 2024

Run the latest version of the Nginx web-server in a docker container. The default Nginx page with be at http://localhost

docker run --rm -p 80:80 --name our_ws nginx

By default, Nginx looks in /usr/share/nginx/html for files to serve. So, mount our own content at that location

docker run --rm -p 80:80 --name our_ws -v $PWD:/usr/share/nginx/html nginx

Leave a comment