So I was trying to follow this tutorial: http://jronnholm.sysio.se/setup-nginx-and-uwsgi-with-python3-on-ubuntu-14-04/
I'm using vagrant and virtualbox with port forwarding from 8080 to 80
root@vagrant:/etc/nginx/sites-available# cat pythonapp
server {
server_name pythonapp;
error_log /var/log/nginx/pythonapp.error.log;
access_log /var/log/nginx/pythonapp.access.log;
root /vagrant/site/python/pythonapp;
location / {
uwsgi_pass unix:/var/run/uwsgi/app/pythonapp/socket;
include uwsgi_params;
}
}
root@vagrant:/etc/nginx/sites-available# cat /etc/uwsgi/apps-available/pythonapp.ini
[uwsgi]
uid=www-data
gid=www-data
# socket line should match uwsgi_pass line in your nginx config
socket = /var/run/uwsgi/app/pythonapp/socket
chown-socket = www-data
chdir = /vagrant/site/python/pythonapp
file = webpage.py
root@vagrant:/etc/nginx/sites-available#
root@vagrant:/vagrant/site/python# ls -l
total 2
drwxrwxrwx 1 vagrant vagrant 0 Feb 7 22:59 pythonapp
-rwxrwxrwx 1 vagrant vagrant 155 Feb 7 19:59 pythonapp.ini
-rwxrwxrwx 1 vagrant vagrant 160 Feb 2 08:27 wsgi.py
-rwxrwxrwx 1 vagrant vagrant 378 Feb 2 08:27 wsgi.pyc
root@vagrant:/vagrant/site/python#
but then when I go to http://localhost:8080 it ends up returning
Welcome to nginx!
If you see this page, the nginx web server is successfully installed and working. Further configuration is required.
For online documentation and support please refer to nginx.org.
Commercial support is available at nginx.com.
Thank you for using nginx.
content of webpage.py
root@vagrant:/vagrant/site/python/pythonapp# cat webpage.py
from bottle import route, run, template, default_app
@route('/hello/<name>')
def index(name):
return template('<b>Hello {{name}}</b>!', name=name)
if __name__ == "__main__":
run(host='localhost', port=8080)
else:
application = default_app()
and when I go to http://localhost:8080/hello/name it ends up returning 404 not found even though the tutorial suggests that going to /hello/name should load the webpage.py...
what am I doing wrong?