我正在使用带有uwsgi和nginx的Django,但每次我都会遇到错误的网关502.请帮帮我。如果您需要更多详细信息,请告诉我
我正在使用emperor for uwsgi这是我的ini文件
Emporer.ini
# /etc/uwsgi/emperor.ini
[uwsgi]
# This is the directory the emperor will watch for new .ini files
emperor = /etc/uwsgi/apps-enabled
# Set the uid and gid. This could be any user you wish
uid = www-data
gid = www-data
# Set the log file path.
# Make sure the log file has the required write
# permissions for the emperor process.
logto = /var/log/uwsgi/emperor.log
ss.ini(django app)
# /etc/uwsgi/apps-available/grub_club.ini
[uwsgi]
# This should point to your Django project directory
chdir = /home/ss1/ss/src/
# This should point to your Django wsgi file.
# This usually lives alongside your settings.py file
module = ss.wsgi:application
# This should point to your python environment
# If you have a virtual environment you like to use,
# specify that here
home = /home/ss1/pro/
master = true
# This is the number of cores on your server
processes = 1
# You can either connect using HTTP OR
# you can use unix sockets (recommended)
socket = /tmp/ss.sock
chmod-socket = 664
# Removes all generated sockets and pids when closed
vacuum = true
# Log file for this Project.
# Make sure the log file has the required write
# permissions for the emperor process.
logto = /var/log/uwsgi/app/ss.log
这是我的nginx位置应用 nginx的/位点可用/ SS
# /etc/nginx/sites-available/ss
upstream ss_cluster{
# This will contain one or more endpoints that uWSGI is listening to
server unix:///tmp/ss.sock;
}
server {
server_name domain.in;
charset utf-8;
#server_name domain.in;
#return 301 $scheme://domain.in$request_uri;
# Configuration to deliver static files
location ^~ /static/ {
# This will point to the folder where all the static files reside
# Same location as Django's STATIC_ROOT
alias /home/ss1/src/ss/static/;
# Sets the HTTP headers for expiration time
location ~* \.(jpg|jpeg|png|gif|ico|css|js|woff)$ {
expires 30d;
}
}
# Configuration to deliver media files
location ^~ /media/ {
# This will point to the folder where all the media files reside
# Same location as Django's MEDIA_ROOT
alias /home/ss1/src/ss/media/;
# Sets the HTTP headers for expiration time
location ~* \.(jpg|jpeg|png|gif){
expires 365d;
}
}
# All other requests are sent to the Django project
location / {
include /etc/nginx/uwsgi_params;
uwsgi_pass ss_cluster;
}
但是我收到了502 Bad Gateway? 在此先感谢