Welcome! Log In Create A New Profile

Advanced

Re: Python on Nginx

Keith Fernie
October 11, 2011 03:08PM
This is what I'm using with Debian Squeeze & fcgiwrap installed, not just
for python.

location ~ (\.cgi|\.py|\.sh|\.pl|\.lua)$ {
gzip off;
root /var/www/$server_name;
autoindex on;
fastcgi_pass unix:/var/run/fcgiwrap.socket;
include /etc/nginx/fastcgi_params;
fastcgi_param DOCUMENT_ROOT /var/www/$server_name;
fastcgi_param SCRIPT_FILENAME
/var/www/$server_name$fastcgi_script_name;
}

Also I chmod +x the python scripts and add
#! /usr/bin/python
to the beginning of the python script.
Change the path if python is located elsewhere.

On Tue, 11 Oct 2011 19:59:50 +0100, Francis Daly <francis@daoine.org>
wrote:

> On Tue, Oct 11, 2011 at 02:43:32PM -0400, etrader wrote:
>
>> You mean to add another location as
>> location ~ \.py$ {
>> fastcgi_pass 127.0.0.1:9000;
>> fastcgi_index index.py;
>> fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
>> include /opt/nginx/conf/fastcgi_params;
>> }
>
> If all of your python urls end in .py, yes.
>
> Although you probably don't want 127.0.0.1:9000, since that's
> your php-fastcgi server. You'll want whatever your python-fastcgi
> server address is: probably 127.0.0.1:8080, if you followed
> http://wiki.nginx.org/PythonFlup
>
> f

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Python on Nginx

etrader October 11, 2011 10:11AM

Re: Python on Nginx

Francis Daly October 11, 2011 02:10PM

Re: Python on Nginx

Igor Sysoev October 12, 2011 05:10AM

Re: Python on Nginx

Brian Akins October 12, 2011 08:04PM

Re: Python on Nginx

roberto October 12, 2011 11:58PM

Re: Python on Nginx

Brian Akins October 13, 2011 07:00AM

Re: Python on Nginx

Cliff Wells October 12, 2011 09:12PM

Re: Python on Nginx

etrader October 11, 2011 02:43PM

Re: Python on Nginx

Francis Daly October 11, 2011 03:00PM

Re: Python on Nginx

Keith Fernie October 11, 2011 03:08PM

Re: Python on Nginx

Cliff Wells October 11, 2011 03:34PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 68
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready