我是新来的Nginx和uWSGI。在
我已经在/var/www/app/
更新了我的index.py
目录。现在当我试图运行http://127.0.0.1/
或cp.myhost.com
时,我得到了一个502 Bad Gateway
错误
这是nginx的配置文件:
`
server {
# Change this if you want to serve your application on another port
listen 80;
# Replace this with your domain name
server_name cp.myhost.com;
# You can use virtual directory like '/apps/' here, but remember that
# this should match 'urls' defined in your web.py application file
location / {
include uwsgi_params;
# This should match the 'socket' entry in your uwsgi configuration
#uwsgi_pass unix:///tmp/uwsgi_vhosts.sock;
uwsgi_pass 127.0.0.1:8080;
# This is the absolute path to the folder containing your application
uwsgi_param UWSGI_CHDIR /var/www/apps;
# This is actually not necessary for our simple application,
# but you may need this in future
uwsgi_param UWSGI_PYHOME /var/www/apps;
# This is the name of your application file, minus the '.py' extension
uwsgi_param UWSGI_SCRIPT index;
}
}
`
这是我在/var/www/app/index.py
的代码
我是新来的,所以请帮帮我。。。 我认为问题出在我的代码中,但它在本地计算机上运行得很顺利。 我无法追踪代码中的错误在哪里。。。在
我认为错误出在这个代码上:
db = MySQLdb.connect(host="localhost",
user="root",
passwd="",
db="cw_api")
cur = db.cursor()
{cd7}没有任何改变。在
我把这个放在/var/log/uwsgi/app/vhost.log
libgcc_s.so.1 must be installed for pthread_cancel to work
- DAMN ! worker 1 (pid: 18262) died, killed by signal 6 :( trying respawn ...
- Respawned uWSGI worker 1 (new pid: 19584)
- WSGI app 0 (mountpoint='cp.myhost.com|') ready in 0 seconds on interprete$
cp.myhost.com {address space usage: 94265344 bytes/89MB} {rss usage: 1175961$
libgcc_s.so.1 must be installed for pthread_cancel to work
- DAMN ! worker 1 (pid: 19584) died, killed by signal 6 :( trying respawn ...
- Respawned uWSGI worker 1 (new pid: 19597)
libgcc_s.so.1 must be installed for pthread_cancel to work
- DAMN ! worker 1 (pid: 19597) died, killed by signal 6 :( trying respawn ...
- Respawned uWSGI worker 1 (new pid: 19633)
libgcc_s.so.1 must be installed for pthread_cancel to work
- DAMN ! worker 1 (pid: 19633) died, killed by signal 6 :( trying respawn ...
- Respawned uWSGI worker 1 (new pid: 19638)
libgcc_s.so.1 must be installed for pthread_cancel to work
- DAMN ! worker 1 (pid: 19638) died, killed by signal 6 :( trying respawn ...
- Respawned uWSGI worker 1 (new pid: 19677)
在我的nginx/error.log
上我看到了这个:
.. 20092#0: *5 upstream prematurely closed connection while reading response header from upstream, ...
我最近也遇到了这个错误,并在这里发布了一个答案https://stackoverflow.com/a/31621481/828841
相关问题 更多 >
编程相关推荐