Deploying Pyramid app: Nginx + Pserve
I've been following this recipe in the Pyramid Cookbook (http://pyramid-cookbook.readthedocs.org/en/latest/deployment/nginx.html) to try and deploy my app on DigitalOcean. It seems to work, I get the message ``Entering daemon mode`` just like I did when running on my local machine.
I've also added my domain name and set up my nameservers to point to DigitalOcean.
When I try to access my site at wisderm.com though, it doesn't load. I'm completely lost at this point -- What am I doing wrong?
This is how my files are structured:
home/
|----env/ # virtualenv
|----MyApp/
|
|----production.ini
|----requirements.txt
|----myapp.sql
|----myapp.psql
|----MyProject
|
|----scripts/
|----static/
|----templates/
|----__init__.py
|----views.py
|----models.py
This is my app.conf:
upstream myapp-site {
server 127.0.0.1:5000;
server 127.0.0.1:5001;
}
server {
server_name wisderm.com;
access_log /home/myapp/access.log;
location / {
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
client_max_body_size 10m;
client_body_buffer_size 128k;
proxy_connect_timeout 60s;
proxy_send_timeout 90s;
proxy_read_timeout 90s;
proxy_buffering off;
proxy_temp_file_write_size 64k;
proxy_pass http://myapp-site;
proxy_redirect off;
}
location /static {
root /home/MyApp;
expires 30d;
add_header Cache-Control public;
access_log off;
}
}
Log In to Comment