ngx_python是为nginx嵌入python脚本的模块。环境
-python2.7.*-nginx-1.6.3+ 安装
```shgit clone https://github.com/rryqszq4/ngx_python.gitwget 'https://nginx.org/download/nginx-1.6.3.tar.gz'tar -zxvf nginx-1.6.3.tar.gzcd nginx-1.6.3export PYTHON_INC=/path/to/python/include/python2.7export PYTHON_BIN=/path/to/python/bin./configure --user=www --group=www \ --prefix=/path/to/nginx \ --add-module=/path/to/ngx_python```摘要
```nginxuser www www;worker_processes 4;events { worker_connections 1024;}http { include mime.types; default_type application/octet-stream; keepalive_timeout 65; server { listen 80; server_name localhost; location /content_by_python { content_by_python "import ngxngx.echo('Hello, ngx_python') "; } } }}```
评论