Skip to content
Embed Python in NGINX.
Python C Makefile
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github Initial commit from cookiecutter. Nov 29, 2018
docs
nginx add location wsgi_pass variable Dec 9, 2018
tests Test NGINX dynamic load module Dec 1, 2018
.editorconfig Initial commit from cookiecutter. Nov 29, 2018
.gitignore Link init process and exit process Nov 30, 2018
.travis.yml
AUTHORS.rst
CONTRIBUTING.rst
HISTORY.rst Update README and HISTORY Nov 30, 2018
LICENSE
MANIFEST.in
Makefile Initial commit from cookiecutter. Nov 29, 2018
README.rst
pyproject.toml Rename package to nginx, and add Cython module Nov 29, 2018
requirements_dev.txt
setup.cfg
setup.py
tox.ini Fix Travis test Dec 1, 2018

README.rst

NGINXpy

Documentation Status Updates

Embed Python in NGINX.

Features

  • Standard Python package with Cython extension
  • Automatically build into NGINX dynamic module for current NGINX install
  • Run embeded Python in NGINX worker processes
  • Write NGINX modules in Python or Cython
  • Python logging module redirected to NGINX error.log
  • (ongoing) NGINX event loop wrapped as Python asyncio interface
  • (TBD) Python and Cython interface to most NGINX code
  • (TBD) Adapt NGINX web server to WSGI, ASGI and aiohttp interfaces

Installation

  1. Install NGINX in whatever way, make sure nginx command is available.
  2. pip install nginxpy, or get the source and run pip install .. You may want to add the -v option, because the process is a bit slow downloading Cython, NGINX source code and configuring it. The usual python setup.py install currently doesn't work separately - you should run python setup.py build first.
  3. Run python -c 'import nginx' to get NGINX configuration hint.
  4. Update NGINX configuration accordingly and reload NGINX.
  5. Visit your NGINX site, see NGINX error.log for now.

Development

  1. Install NGINX in whatever way, make sure nginx command is available.
  2. Checkout source code.
  3. Run python setup.py build && python setup.py develop.
  4. Run python -c 'import nginx' to get NGINX configuration hint.
  5. Update NGINX configuration accordingly and reload NGINX.
  6. Visit your NGINX site, see NGINX error.log for now.
  7. Change code if result is not satisfying, or else go for pull request.
  8. Goto 3 if Cython code was changed, or else goto 5.

Surprisingly NGINX has a very simple but powerful architecture, learn about it here: http://nginx.org/en/docs/dev/development_guide.html

Credits

This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.

You can’t perform that action at this time.