You are not logged in.

#1 2013-02-19 14:17:34

Registered: 2013-02-19
Posts: 2

[SOLVED][Nginx/Flask/uWGSI] Problems mounting server


First of all, excuse me for my English. I hope you will unterstand my problem.

I've been mounting my web server these two last weeks. All was functionnal until I reboot my server. It is served by nginx and the website was developped with Python using Flask and Jinja2 for the templates. I've been searching for the problems but couldn't find it.

Here my nginx conf :

user web;
worker_processes  2;

events {
    worker_connections  1024;

http {
    include       mime.types;
    default_type  application/octet-stream;
    keepalive_timeout  65;
    gzip  on;

    server {
        listen       80;
        charset utf-8;

	location / { try_files $uri @yourapplication; }
		location @yourapplication {
    			include uwsgi_params;
    			uwsgi_pass unix:/tmp/uwsgi.sock;

It seems to be OK... For redirecting port, I use uWSGI with sockets (as you can see in the nginx conf). Permissions problems ?

srwxr-xr-x  1 web  web     0 19 févr. 14:58 uwsgi.sock

Than I've been looking for the error.log file provided by Nginx :

2013/02/19 14:48:58 [error] 260#0: *99 connect() to unix:/tmp/uwsgi.sock failed (111: Connection refused) while connecting to upstream, client:, server:, request: "GET /favicon.ico HTTP/1.1", upstream: "uwsgi://unix:/tmp/uwsgi.sock:", host: ""

Connection refused ? What does it mean ? I've already searched but I didn't find the answer.
I'm sure my .py file is correct but I prefer post...

from flask import Flask, request, session, g, redirect, url_for, abort, render_template, flash

app = Flask(__name__)

def index():
    return render_template('index.html', foo='42')

def about():
    return render_template('about.html', foo='42')

if __name__ == '__main__': 

I'm running the server using :

 uwsgi -s /tmp/uwsgi.sock -w splab:app 



runned in the / of nginx directory (/usr/share/nginx/html/)

My website link :


Last edited by Jlzz (2013-02-21 20:07:10)


#2 2013-02-20 18:32:32

Registered: 2013-02-19
Posts: 2

Re: [SOLVED][Nginx/Flask/uWGSI] Problems mounting server

Little up ! No idea ?

EDIT: Problem solved.

Last edited by Jlzz (2013-02-21 20:06:46)


Board footer

Powered by FluxBB