Navigate back to the homepage

Simple local Nginx

Sergey Pogorelov
February 4th, 2020 · 1 min read

It’s preety simple to run a local Nginx web server for test purposes.

First of all we need to pull the Nginx docker image

1docker pull nginx

Now we can run it:

1docker run \
2--name blog-nginx \
3-p 80:80 \
4-v ~/Git/blog/dist/:/usr/share/nginx/html:ro \
5-d nginx

Here we specify port forwarding with the -p option and mount the web directory for Nginx through the -v option.

That’s it, now we have a running Nginx that serves our content.

Join my email list and get notified about new content

Be the first to receive my latest content with the ability to opt-out at anytime. I promise not to spam your inbox or share your email with any third parties.

More articles from Pogorelovs

OS X environment setup guide

When I used Ubuntu as my main system I experimented a lot and often reinstalled the system. I’ve got to the conclusion that it might be handy to have a list of steps to do after a fresh system install...

December 7th, 2018 · 1 min read

How to become a software developer?

Want to be a software developer and don't know where to start? This post is exactly for you! Nowadays a lot of people are interested in becoming a software developer. Some of them love computers and technologies and some of them just want to switch their job to a better paid one. The amount of software development courses and boot camps are instantly growing and there are more and more developers...

October 19th, 2018 · 3 min read
© 2018–2020 Pogorelovs
Link to $https://github.com/sergeioffLink to $https://www.linkedin.com/in/sergeioff