Testing your nginx configuration alteration in Gitlab Omnibus

If you’re familiar with nginx, you probably know to run nginx -t to test your config changes are valid before reloading the service.

If you are running nginx through the embedded version of Gitlab Omnibus, it’s slightly more tricky.

Say you’ve include some additional hosts to it (via nginx['custom_nginx_config'])

If you want to test that it’s correct before reloading everything the syntax is:

/opt/gitlab/embedded/sbin/nginx -p /var/opt/gitlab/nginx -t

Path to nginx, with custom configuration path to the config /var/opt/gitlab/nginx, and finally -t to test it out.

Leave a Reply

Your email address will not be published. Required fields are marked *