Created
July 7, 2011 15:10
-
-
Save rochacbruno/1069723 to your computer and use it in GitHub Desktop.
NGINX + UWSGI for web2py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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