Need help with nginxparser?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

fatiherikli
483 Stars 106 Forks MIT License 44 Commits 21 Opened issues

Description

Parses nginx configuration with Pyparsing — Used in Letsencrypt

Services available

!
?

Need anything else?

Contributors list

# 32,679
React
computa...
Django
Crystal
22 commits
# 436,429
Python
2 commits
# 414,166
Python
HTML
Shell
django-...
2 commits
# 21,264
python-...
testing...
circlec...
webfram...
1 commit
# 225,725
Shell
oauth2
jwt-aut...
python-...
1 commit
# 389,340
Python
1 commit
# 508,132
Python
1 commit

Nginx Configuration Parser

An nginx configuration parser that uses Pyparsing.

You can parse a nginx configuration file with

load
or
loads
method:
>>> from nginxparser import load
>>> load(open("/etc/nginx/sites-enabled/foo.conf"))

[['server'], [ ['listen', '80'], ['server_name', 'foo.com'], ['root', '/home/ubuntu/sites/foo/']]]]

Same as other serialization modules also you can export configuration with

dump
and
dumps
methods.
>>> from nginxparser import dumps
>>> dumps([['server'], [
            ['listen', '80'],
            ['server_name', 'foo.com'],
            ['root', '/home/ubuntu/sites/foo/']]])

'server { listen 80; server_name foo.com; root /home/ubuntu/sites/foo/; }'

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.