Welcome! Log In Create A New Profile

Advanced

Nginx configuration test (out of the box/in non-production env.)

Posted by maran.randl 
Nginx configuration test (out of the box/in non-production env.)
December 31, 2014 03:19AM
Hey Guys
I'm looking for a way to test nginx configuration syntax in the non-production environment..
I found there is reliable way - "nginx -t -c $configfile". But this tests more things than syntax(hostnames, linked files, etc).

Q:: Is there any way to test just the syntax(if is useable for nginx or not) ???

-----------------------
The goal/reason:
Database containing all configuration file names, types , etc..
I have the configfiles repository containing all configuraton files from all servers.. (10000 files).
And I would like to find type of each one file..

I want to run test function for all types for each one file. And write result (FALSE/TRUE) for each test to DB..
(cfg_httpd=FALSE, cfg_nginx=TRUE, cfg_ini=FALSE, etc..)

This DB will be used to decide which config parser will be used for further processing..

-----------------------
Any help would be greatly appreciated :-)
Thanks!
Re: Nginx configuration test (out of the box/in non-production env.)
December 31, 2014 05:26AM
This just an example: https://github.com/openresty/echo-nginx-module/tree/master/t
the point is there are test systems out there which can be adjusted to what you want to test.

http://www.modernperlbooks.com/mt/2013/05/running-named-perl-tests-from-prove.html

---
nginx for Windows http://nginx-win.ecsds.eu/
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 124
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready