Docker is right approach for me. Let say I have following config:
In short, I'm going to pass nginx config to running nginx instance and look to the logs.
Put you nginx.config to the temp and start the docker image:
sudo docker run --name nginx -v /tmp/nginx.config:/etc/nginx/nginx.conf:ro -d nginxIt uses volume mapping so the command just starts a new docker container and mounts a local /tmp/nginx.config to the given in-container path. You can obviously change the volume path to your personal path. Is it working or not? Look at logs.
sudo docker logs nginxIf there is no entry, your file is fine. In the case of an error, you can see something like this:
2016/01/08 11:37:31 [emerg] 1#1: unexpected "}" in /etc/nginx/nginx.conf:44Note that if you want to validate the file again just stop, remove and then start container again, e.g.:
nginx: [emerg] unexpected "}" in /etc/nginx/nginx.conf:44
sudo docker stop nginx
sudo docker rm nginx
0 comments:
Post a Comment