Skip to main content

nginx config file formatter/beautifier written in Python.

Project description

# *nginx* config file formatter

[![Build Status](](

This Python script formats *nginx* configuration files in consistent
way, described below:

* all lines are indented in uniform manner, with 4 spaces per level
* neighbouring empty lines are collapsed to at most two empty lines
* curly braces placement follows Java convention
* whitespaces are collapsed, except in comments an quotation marks
* whitespaces in variable designators are removed: `${ my_variable }` is collapsed to `${my_variable}`

## Installation

`pip install nginxfmt`

## Usage

usage: nginxfmt [-h] [-v] [-b] config_files [config_files ...]

Script formats nginx configuration file.

positional arguments:
config_files configuration files to format

optional arguments:
-h, --help show this help message and exit
-v, --verbose show formatted file names
-b, --backup-original
backup original config file

## Credits

Copyright 2016 Michał Słomkowski @ 1CONNECT. License: Apache 2.0.


1.0.2 (2017-09-18)

* First release on PyPI.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for nginxfmt, version 1.0.6
Filename, size File type Python version Upload date Hashes
Filename, size nginxfmt-1.0.6.tar.gz (11.1 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page