Skip to content

Instantly share code, notes, and snippets.

@rochacbruno
Created July 7, 2011 15:10
Show Gist options
  • Save rochacbruno/1069723 to your computer and use it in GitHub Desktop.
Save rochacbruno/1069723 to your computer and use it in GitHub Desktop.
NGINX + UWSGI for web2py
server {
server_name yourdomain.com.br yourdomain.net www.yourdomain.net;
rewrite ^/(.*) http://www.yourdomain.com.br/$1 permanent;
}
server {
listen 80;
server_name www.yourdomain.com.br
access_log /home/www-data/logs/access_yourdomain.log;
error_log /home/www-data/logs/error_yourdomain.log;
location ~* /(\w+)/static/ {
root /home/www-data/yourdomain/applications/;
}
location / {
uwsgi_pass 127.0.0.1:9003;
include uwsgi_params;
}
}
server {
listen 443;
server_name www.yourdomain.com.br yourdomain.com.br;
ssl on;
ssl_certificate /etc/nginx/ssl/web2py.crt;
ssl_certificate_key /etc/nginx/ssl/web2py.key;
location / {
uwsgi_pass 127.0.0.1:9003;
include uwsgi_params;
uwsgi_param UWSGI_SCHEME $scheme;
}
}
<uwsgi>
<socket>127.0.0.1:9006</socket>
<pythonpath>/home/www-data/yourdomain/</pythonpath>
<app mountpoint="/">
<script>wsgihandler</script>
</app>
</uwsgi>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment