Giter VIP home page Giter VIP logo

nginxpy's Introduction

NGINXpy

image

image

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.

nginxpy's People

Contributors

fantix avatar tomatoy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nginxpy's Issues

Embedding nginxpy in nginx.conf ?

Is this software meant to embed python in nginx like how lua is embedded in nginx ?

I have yet to find any documentation nor example *.conf file which illustrate this embedding.

The docs link is broken.

Cheers

asyncio loop shutdown

Write a dead loop with asyncio.sleep(1) and log something, reload NGINX and the loop wouldn't stop.

error: ‘nginxpy_post_read’ undeclared

/projects/nginxpy/nginx/ngx_python_module.c: In function ‘ngx_python_postconfiguration’:
/projects/nginxpy/nginx/ngx_python_module.c:116:10: error: ‘nginxpy_post_read’ undeclared (first use in this function)
  116 |     *h = nginxpy_post_read;
      |          ^~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
make[1]: *** [objs/Makefile:2152: objs/addon/nginx/ngx_python_module.o] Error 1
make[1]: Leaving directory '/opt/nginx-1.23.3'
make: *** [Makefile:10: build] Error 2

how to fix it ?. any idea ?. thank's

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.