# Configure core Python scripts into Nginx

**URL:** <https://www.ruby-forum.com/t/configure-core-python-scripts-into-nginx/242890>\
**Category:** NGINX\
**Created:** [August 5, 2015, 4:26pm UTC](https://www.ruby-forum.com/t/configure-core-python-scripts-into-nginx/242890 "2015-08-05T16:26:21Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sadaf\_N](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/858c86/32.png) [@Sadaf\_N](https://www.ruby-forum.com/u/Sadaf_N)\
**Post date:** [August 5, 2015, 4:26pm UTC](https://www.ruby-forum.com/t/configure-core-python-scripts-into-nginx/242890/1 "2015-08-05T16:26:21Z")

</div>

Hi,  
I want to execute python scripts into Nginx server. I don’t  
want  
to any frameworks for that. Core python script, I need to use.  
Any help and step to follow . To do that.

---

<div class="post-metadata">

**Author:** ![Nitin\_S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/7bcc69/32.png) [@Nitin\_S](https://www.ruby-forum.com/u/Nitin_S)\
**Post date:** [August 5, 2015, 5:23pm UTC](https://www.ruby-forum.com/t/configure-core-python-scripts-into-nginx/242890/2 "2015-08-05T17:23:01Z")

</div>

Hello!

On Wed, Aug 5, 2015 at 10:25 PM, Nitin S. wrote:

> ```
> I want to execute python scripts into Nginx server. I don't want to
> 
> ```
> 
> any frameworks for that. Core python script, I need to use.  
> Any help and step to follow . To do that.

Because you’re using NGINX, I’d assume you’re after performance. I  
suggest you have a look at our ngx\_lua module which supports  
nonblocking Lua scripting in the nginx core:

```
https://github.com/openresty/lua-nginx-module

```

Lua is a simple language and is pythanic in some ways 🙂

If you insist in running Python in your apps, then you should try  
those fastcgi or uwsgi options instead.

Just my 2 cents.

Regards,  
-agentzh

---

<div class="post-metadata">

**Author:** ![Nitin\_S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/7bcc69/32.png) [@Nitin\_S](https://www.ruby-forum.com/u/Nitin_S)\
**Post date:** [August 6, 2015, 8:52am UTC](https://www.ruby-forum.com/t/configure-core-python-scripts-into-nginx/242890/3 "2015-08-06T08:52:28Z")

</div>

Hi Zhang,  
Which should I use fastcgi or uwsgi. I tried uwsgi but not  
succeed. Can you help to sort out my problem. Shall you please send me  
steps to configure python with Nginx.

On Wed, Aug 5, 2015 at 8:52 PM Yichun Z. (agentzh)  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![Nitin\_S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/7bcc69/32.png) [@Nitin\_S](https://www.ruby-forum.com/u/Nitin_S)\
**Post date:** [August 6, 2015, 3:50pm UTC](https://www.ruby-forum.com/t/configure-core-python-scripts-into-nginx/242890/4 "2015-08-06T15:50:47Z")

</div>

Hello!

On Thu, Aug 6, 2015 at 2:51 PM, Nitin S. wrote:

> Which should I use fastcgi or uwsgi.

It’s generally believed that uwsgi is better.

> I tried uwsgi but not  
> succeed. Can you help to sort out my problem. Shall you please send me steps  
> to configure python with Nginx.

As the maintainer of the ngx\_lua module I never code any Python for  
web apps (for obvious reasons) 🙂 I only use Python occasionally when  
I absolutely have to (like writing gdb-based debugging tools).

Having said that, you’d better provide as much details about your  
problems as possible here such that other more knowledgeable people  
might have a chance to help you out. Well, just a suggestion.

Regards,  
-agentzh

---

<div class="post-metadata">

**Author:** ![Nitin\_S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/7bcc69/32.png) [@Nitin\_S](https://www.ruby-forum.com/u/Nitin_S)\
**Post date:** [August 6, 2015, 7:54pm UTC](https://www.ruby-forum.com/t/configure-core-python-scripts-into-nginx/242890/5 "2015-08-06T19:54:24Z")

</div>

## Ray Cote Wrote:

> We use gUnicorn for our nginx/Django deployments.  
> Lots of good guidance on the gUnicorn site:  
> [http://gunicorn-docs.readthedocs.org/en/latest/deploy.html](http://gunicorn-docs.readthedocs.org/en/latest/deploy.html)  
> nginx is their deployment of choice…  
> -Ray

gunicorn (+nginx for static content, caching, ssl-offload and  
waf-features)  
is what we use here  
too on a couple of installations; its rock solid and easy to use.

cheers,

mex

Posted at Nginx Forum:  
[http://forum.nginx.org/read.php?2,260791,260824#msg-260824](http://forum.nginx.org/read.php?2,260791,260824#msg-260824)

---

<div class="post-metadata">

**Author:** ![Nitin\_S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/7bcc69/32.png) [@Nitin\_S](https://www.ruby-forum.com/u/Nitin_S)\
**Post date:** [August 6, 2015, 8:07pm UTC](https://www.ruby-forum.com/t/configure-core-python-scripts-into-nginx/242890/6 "2015-08-06T20:07:50Z")

</div>

Hi all, I am not using any python framework. Generally, I use core  
python  
and making a call from php to python using AJAX. I found different ways  
to  
configure python with Nginx but they all have python framework  
integration.  
Any configuration, you have to follow for core python scripts Please  
help  
me.

---

<div class="post-metadata">

**Author:** ![Nitin\_S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/7bcc69/32.png) [@Nitin\_S](https://www.ruby-forum.com/u/Nitin_S)\
**Post date:** [August 6, 2015, 8:14pm UTC](https://www.ruby-forum.com/t/configure-core-python-scripts-into-nginx/242890/7 "2015-08-06T20:14:16Z")

</div>

if you ask for something like mod\_cgi from the apache-world, there is  
nothing like  
this; the following article might help to define requirements and find a  
solution:

> 

> **[A Comparison of Web Servers for Python Based Web Applications | DigitalOcean](https://www.digitalocean.com/community/tutorials/a-comparison-of-web-servers-for-python-based-web-applications)**
>
> In this article, we will talk about three main things: Python, Web Servers, and most importantly the bits and bobs in-between the two.

## Nitin S. Wrote:

> Hi all, I am not using any python framework. Generally, I use core  
> python  
> and making a call from php to python using AJAX. I found different  
> ways to  
> configure python with Nginx but they all have python framework  
> integration.  
> Any configuration, you have to follow for core python scripts Please  
> help  
> me.

Posted at Nginx Forum:  
[http://forum.nginx.org/read.php?2,260791,260826#msg-260826](http://forum.nginx.org/read.php?2,260791,260826#msg-260826)

---

<div class="post-metadata">

**Author:** ![Nitin\_S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/7bcc69/32.png) [@Nitin\_S](https://www.ruby-forum.com/u/Nitin_S)\
**Post date:** [August 6, 2015, 8:17pm UTC](https://www.ruby-forum.com/t/configure-core-python-scripts-into-nginx/242890/8 "2015-08-06T20:17:11Z")

</div>

Hi,  
Which one is better to configure with Nginx? Please can you suggest  
me  
with steps. I explored more but didn’t getting anything. It will be very  
helpful for me. If you guide me in steps. Thanks…

---

<div class="post-metadata">

**Author:** ![Nitin\_S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/7bcc69/32.png) [@Nitin\_S](https://www.ruby-forum.com/u/Nitin_S)\
**Post date:** [August 6, 2015, 7:38pm UTC](https://www.ruby-forum.com/t/configure-core-python-scripts-into-nginx/242890/9 "2015-08-06T19:38:38Z")

</div>

We use gUnicorn for our nginx/Django deployments.  
Lots of good guidance on the gUnicorn site:  
[http://gunicorn-docs.readthedocs.org/en/latest/deploy.html](http://gunicorn-docs.readthedocs.org/en/latest/deploy.html)  
nginx is their deployment of choice…  
-Ray

On Thu, Aug 6, 2015 at 9:49 AM, Yichun Z. (agentzh)  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
