Open creamidea opened 8 years ago
BTW, here is the nginx proxy inverse
server
{
listen 80;
server_name xxx456.tk;
location / {
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://192.168.10.40:80;
}
access_log logs/xxx456.tk_access.log;
}
Nginx configure:
http {
...
upstream django {
# server 127.0.0.1:8001;
server unix:///tmp/xxxxx.sock;
}
...
server {
...
location /zdl {
include /home/wweixnpy/uwsgi_params;
uwsgi_pass django;
}
location /weixnpystatic {
alias /home/weixnpy/static;
}
}
}
Test that uwsgi process is still alive every minute. (maybe, it is fine for you to run the crontab
using the same account as uwsgi.
$ crontab -e
* * * * * /bin/bash /home/wx/weixnpy/watch_dog.sh > /dev/null 2>&1
At last, make sure it is running.
$ crontab -l
$ sudo /etc/init.d/crond status # restart
XD
This is a disgust problem!!!
One way of solving this problem is to watch the error.log
First, you should know which encode the system is using. You can use
locale
to look at. Second, make sure your nginx is using the same code as the system. You can put this in nginx.confAt last, make sure your Django(Python) using the same code as the nginx. You can put this code in your
/your/path/to/lib/python2.7/sitecustomize.py
.Good luck.
PS: uwsgi ini file format