Im having a weird issue with a django project called satchmo, Im deploying with nginx and uwsgi.
Whats happening is that the application does respond and it redirects to https and then to http and back to https until nginx stops and the application never responds.
Help me figure out this. Thank you!
this is my sites-available config file for nginx:
server {
listen 80;
server_name miche.maumercado.com;
rewrite ^ https://$server_name$request_uri? permanent;
}
server {
listen 443;
charset utf-8;
server_name miche.maumercado.com;
ssl on;
ssl_certificate /home/ubuntu/test.pem;
ssl_certificate_key /home/ubuntu/cert-EO5rjY;
access_log /home/ubuntu/logs/miche/nginx/access.log;
error_log /home/ubuntu/logs/miche/nginx/error.log;
client_max_body_size 100m;
location ^~ /static/ {
alias /home/ubuntu/django-projects/miche_store/static-collect/;
expires max;
}
location ^~ /media/ {
alias /home/ubuntu/django-projects/miche_store/media/;
expires max;
}
location / {
uwsgi_pass unix:/tmp/uwsgi_miche.sock;
include /etc/nginx/uwsgi_params;
}
}
This is the uwsgi.conf file in /etc/init:
# file: /etc/init/uwsgi_miche.conf
description "uWSGI starter"
start on (local-filesystems and runlevel [2345])
stop on runlevel [016]
respawn
# home - is the path to our virtualenv directory
# pythonpath - the path to our django application
# module - the wsgi handler python script
exec /home/ubuntu/ve/miche_store/bin/uwsgi \
--uid ubuntu \
--pythonpath /home/ubuntu/django-projects/miche_store \
-H /home/ubuntu/ve/miche_store \
--socket /tmp/uwsgi_miche.sock \
--chmod-socket 644 \
--module wsgi \
--logdate \
--optimize 2 \
--processes=6 \
--max-requests=5000 \
--master \
--vacuum \
--logto /home/ubuntu/logs/miche/uwsgi.log
And heres my wsgi.py file:
import os
import sys
import site
site.addsitedir('/home/ubuntu/ve/miche_store/lib/python2.6/site-packages')
sys.path.append(os.path.abspath(os.path.dirname(__file__)))
sys.path.append(os.path.join(os.path.realpath(os.path.dirname(__file__)), '../'))
os.environ['DJANGO_SETTINGS_MODULE'] = 'miche_store.settings'
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()
Thank you all for your help!