I have setup an Nginx server with following configuration:
server {
listen 8080;
server_name localhost;
location / {
include uwsgi_params;
uwsgi_pass unix:/tmp/uwsgi.notesapi.socket;
uwsgi_param UWSGI_PYHOME /home/ubuntu/notesAPI/env;
uwsgi_param UWSGI_CHIDIR /home/ubuntu/notesAPI/src;
uwsgi_param UWSGI_SCRIPT Notes;
}
}
I have setup a bottle app with initial following initial script:
import sys from settings.constants import PROJECT_ROOT print PROJECT_ROOT sys.path.insert(0, PROJECT_ROOT)
import bottle from bottle import Bottle, debug from settings import routes
Notes = Bottle() routes.set(Notes)
debug(True)
if __name__ == '__main__':
Notes.run(host='0.0.0.0', port=8080, reloader=True)
else:
application = bottle.default_app()
When I send a GET request to the server I get a 404 even though the routes are perfectly set.
Here is the uwsgi.log
:
[uWSGI] getting INI configuration from /usr/share/uwsgi/conf/default.ini
[uWSGI] getting INI configuration from /etc/uwsgi/apps-enabled/uwsgi.ini
Fri Jun 21 04:47:26 2013 - * Starting uWSGI 1.0.3-debian (64bit) on [Fri Jun 21 04:47:26 2013] *
Fri Jun 21 04:47:26 2013 - compiled with version: 4.6.3 on 17 July 2012 02:26:54
Fri Jun 21 04:47:26 2013 - current working directory: /
Fri Jun 21 04:47:26 2013 - writing pidfile to /run/uwsgi/app/uwsgi/pid
Fri Jun 21 04:47:26 2013 - detected binary path: /usr/bin/uwsgi-core
Fri Jun 21 04:47:26 2013 - setgid() to 33
Fri Jun 21 04:47:26 2013 - setuid() to 33
Fri Jun 21 04:47:26 2013 - your memory page size is 4096 bytes
Fri Jun 21 04:47:26 2013 - uwsgi socket 0 bound to UNIX address /run/uwsgi/app/uwsgi/socket fd 5
Fri Jun 21 04:47:26 2013 - uwsgi socket 1 bound to UNIX address /tmp/uwsgi.notesapi.socket fd 6
Fri Jun 21 04:47:26 2013 - Python version: 2.7.3 (default, Aug 1 2012, 05:25:23) [GCC 4.6.3]
Fri Jun 21 04:47:26 2013 - Set PythonHome to /home/ubuntu/notesAPI/env
Fri Jun 21 04:47:26 2013 - Python main interpreter initialized at 0x1f27e60
Fri Jun 21 04:47:26 2013 - your server socket listen backlog is limited to 100 connections Fri Jun 21 04:47:26 2013 - * Operational MODE: preforking *
Fri Jun 21 04:47:26 2013 - added /home/ubuntu/notesAPI/src/ to pythonpath.
Fri Jun 21 04:47:26 2013 - * no app loaded. going in full dynamic mode *
Fri Jun 21 04:47:26 2013 - * uWSGI is running in multiple interpreter mode *
Fri Jun 21 04:47:26 2013 - spawned uWSGI master process (pid: 25575)
Fri Jun 21 04:47:26 2013 - spawned uWSGI worker 1 (pid: 25583, cores: 1)
Fri Jun 21 04:47:26 2013 - spawned uWSGI worker 2 (pid: 25584, cores: 1)
/home/ubuntu/notesAPI/src
Fri Jun 21 04:55:28 2013 - WSGI application 0 (mountpoint='') ready on interpreter 0x1f27e60 pid: 25583 (default app) [pid: 25583|app: 0|req: 1/1] 117.196.135.124 () {44 vars in 686 bytes} [Fri Jun 21 04:55:28 2013] GET / => generated 723 bytes in 188 msecs (HTTP/1.1 404) 2 headers in 87 bytes (1 switches on core 0)
I am pretty new to uwsgi and nginx. I can't seem to figure out the problem.