Sign inSign up

uwegerdes/nginx

By uwegerdes

•Updated over 6 years ago

web server nginx for my sample frontend-development application

Image
0

1.1K

uwegerdes/nginx repository overview

⁠Docker uwegerdes/nginx

⁠Build

Build the image with (mind the dot):

$ docker build -t uwegerdes/nginx .

⁠Usage

Make sure you run uwegerdes/php-fpm and the other containers before running nginx.

Now run the nginx container, port 8080 on localhost will be connected to the nginx container (change it as you like):

$ docker run -d \
	-v $(pwd)/htdocs:/var/www/htdocs \
	-p 8080:80 \
	--link php-fpm \
	--name nginx \
	uwegerdes/nginx

To use different configuration add the following lines

	-v $(pwd)/nginx/nginx.conf:/etc/nginx/nginx.conf \
	-v $(pwd)/nginx/sites-enabled/default:/etc/nginx/sites-enabled/default \

Useful commands:

$ docker exec -it nginx tail -f /var/log/nginx/access.log
$ docker exec -it nginx bash

Hit CTRL-C to stop the tail command and CTRL-D to exit the bash.

⁠Open Page

Open http://localhost:3080/⁠ in your preferred browser - you should see the /htdocs/index.html content. Change the file and reload it.

⁠Known Problems

Internal redirection (e.g. rewriting, index.php in subdirectories) is not possible with this sites-enabled/default - see my frontend-development project for a default configuration⁠ with index.php support in a subdirectory.

Tag summary

Content type

Image

Digest

Size

126.1 MB

Last updated

over 6 years ago

docker pull uwegerdes/nginx