Is there a formatter/beautifier for NGINX config files?

config, formatting, nginx

Solution

I found a few projects which might suit your needs:

- Nginx Formatter (python) by 1connect you can get it here

- Nginx beautifier (js/nodejs) by vasilevich nginxbeautifier.com which lets you format configs quickly in a web browser. you can get a command line tool also on the same site to run it locally.

Problem

I know this may sound a little stupid, but one of my NGINX config files is a piece of crap when it comes to formatting. It works and all but that's about it. I tried to find some kind of beautifier or formatter, like http://jsbeautifier.org/ but then for nginx config files instead of javascript, but no luck so far. I hope anyone would have a suggestion. There are no requirements, as long as it can format quickly / lazily made NGINX config files! Thanks!

Original source