ZHT5178 大佬有话说 :
nano-cf-panel搭建的问题
刚解决了宝塔默认python版本和本项目环境要求的版本不同的环境问题,
但是现在发现总是502错误
运行 uWSGI 后的启动日志:
uWSGI] getting INI configuration from panel.ini
added mapping for /static => static
*** Starting uWSGI 2.0.18 (64bit) on ***
compiled with version: 4.8.5 20150623 (Red Hat 4.8.5-39) on 10 May 2020 09:55:59
os: Linux-5.6.5-1.el7.elrepo.x86_64 #1 SMP Thu Apr 16 14:02:22 EDT 2020
nodename: static.100.97.217.95.clients.your-server.de
machine: x86_64
clock source: unix
pcre jit disabled
detected number of CPU cores: 8
current working directory: /www/wwwroot/cf.xxxxxx.com
detected binary path: /www/wwwroot/cf.xxxxxx.com/cfp3_venv/bin/uwsgi
uWSGI running as root, you can use –uid/–gid/–chroot options
*** WARNING: you are running uWSGI as root !!! (use the –uid flag) ***
chdir() to /www/wwwroot/cf.xxxxxx.com
*** WARNING: you are running uWSGI without its master process manager ***
your processes number limit is 11605
your memory page size is 4096 bytes
detected max file descriptor number: 1024
building mime-types dictionary from file /etc/mime.types…1060 entry found
lock engine: pthread robust mutexes
thunder lock: disabled (you can enable it with –thunder-lock)
uWSGI http bound on 0.0.0.0:8001 fd 4
spawned uWSGI http 1 (pid: 28092)
uwsgi socket 0 bound to TCP address 127.0.0.1:44389 (port auto-assigned) fd 3
uWSGI running as root, you can use –uid/–gid/–chroot options
*** WARNING: you are running uWSGI as root !!! (use the –uid flag) ***
Python version: 3.7.1 (default, May 10 2020, 17:05:03)
Python main interpreter initialized at 0x138dd00
uWSGI running as root, you can use –uid/–gid/–chroot options
*** WARNING: you are running uWSGI as root !!! (use the –uid flag) ***
python threads support enabled
your server socket listen backlog is limited to 100 connections
your mercy for graceful operations on workers is 60 seconds
mapped 833760 bytes (814 KB) for 20 cores
*** Operational MODE: preforking+threaded ***
WSGI app 0 (mountpoint=”) ready in 1 seconds on interpreter 0x138dd00 pid: 28091 (default app)
uWSGI running as root, you can use –uid/–gid/–chroot options
*** WARNING: you are running uWSGI as root !!! (use the –uid flag) ***
*** uWSGI is running in multiple interpreter mode ***
spawned uWSGI worker 1 (pid: 28091, cores: 2)
spawned uWSGI worker 2 (pid: 28094, cores: 2)
spawned uWSGI worker 3 (pid: 28095, cores: 2)
spawned uWSGI worker 4 (pid: 28096, cores: 2)
spawned uWSGI worker 5 (pid: 28098, cores: 2)
spawned uWSGI worker 6 (pid: 28101, cores: 2)
spawned uWSGI worker 7 (pid: 28103, cores: 2)
spawned uWSGI worker 8 (pid: 28105, cores: 2)
spawned uWSGI worker 9 (pid: 28107, cores: 2)
spawned uWSGI worker 10 (pid: 28109, cores: 2)
panel.ini:
http = 0.0.0.0:8001
chdir = /www/wwwroot/cf.xxxxxx.com
wsgi-file=mysite/wsgi.py
processes = 10
threads = 2
static-map=/static=static
nginx:
server {
listen 80;
listen 443 ssl http2;
server_name cf.xxxxxx.com; #你的ip或者站点域名
access_log/www/wwwlogs/cf.xxxxxx.com.log;
error_log/www/wwwlogs/cf.xxxxxx.com.error.log;
location /{
include /www/server/nginx/conf/scgi_params;
uwsgi_pass 127.0.0.1:8001; #uwgis的反向代理接收端口
}
#SSL-START SSL相关配置,请勿删除或修改下一行带注释的404规则
#error_page 404/404.html;
#HTTP_TO_HTTPS_START
if ($server_port !~ 443){
rewrite ^(/.*)$ https://$host$1 permanent;
}
#HTTP_TO_HTTPS_END
ssl_certificate /www/server/panel/vhost/cert/cf.xxxxxx.com/fullchain.pem;
ssl_certificate_key /www/server/panel/vhost/cert/cf.xxxxxx.com/privkey.pem;
ssl_protocols TLSv1.1 TLSv1.2 TLSv1.3;
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE;
ssl_prefer_server_ciphers on;
ssl_session_cache shared:SSL:10m;
ssl_session_timeout 10m;
error_page 497https://$host$request_uri;
#SSL-END
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
location /static {
alias /www/wwwroot/cf.xxxxxx.com/static/;#静态文件路径
}
location /templates {
alias /www/wwwroot/cf.xxxxxx.com/templates/;#静态html模板路径
}
}
访问目标域名 cf.xxxxxx.com
调试器控制台出现:
GET https://cf.xxxxxx.com/ 502
favicon.ico:1 GET https://cf.xxxxxx.com/favicon.ico 502
呼叫作者大佬 @tonyma
非常喜欢这个cfp合作面板大气的样子,还带多语言