File tree Expand file tree Collapse file tree 4 files changed +75
-0
lines changed
Expand file tree Collapse file tree 4 files changed +75
-0
lines changed Original file line number Diff line number Diff line change 1+ upstream python_bbs {
2+ # 开始书写我们的 ip 地址
3+ server 192.168.183.128;
4+ }
5+
6+ server {
7+ # 实现监听端口号
8+ listen 8001 ssl;
9+
10+ ssl_certificate /etc/letsencrypt/live/your-domain.com/fullchain.pem; # SSL 证书文件路径
11+ ssl_certificate_key /etc/letsencrypt/live/your-domain.com/privkey.pem; # SSL 私钥文件路径
12+
13+ # SSL 配置最佳实践
14+ ssl_protocols TLSv1.2 TLSv1.3; # 使用安全的 SSL/TLS 协议
15+ ssl_prefer_server_ciphers on;
16+ ssl_ciphers 'EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH';
17+ ssl_session_cache shared:SSL:10m;
18+ ssl_session_timeout 10m;
19+ ssl_session_tickets off;
20+ ssl_stapling on;
21+ ssl_stapling_verify on;
22+ resolver 8.8.8.8 8.8.4.4 valid=300s;
23+ resolver_timeout 5s;
24+
25+ # 服务器域名或者 ip地址,就是我们的到时候浏览器实现搜搜索的地址
26+ server_name 192.168.183.128;
27+
28+ # 编码格式
29+ charset utf-8;
30+
31+ # 文件上传最大大小
32+ client_max_body_size 100M;
33+
34+ # 媒体文件
35+ location /media {
36+ # 绝对路径
37+ alias /home/juwenzhang/桌面/python_bbs/media;
38+ }
39+
40+ # 静态文件
41+ location /static {
42+ alias /home/juwenzhang/桌面/python_bbs/static;
43+ }
44+
45+ # 主目录的配置
46+ location / {
47+ uwsgi_pass python_bbs;
48+ include /etc/nginx/uwsgi_params;
49+ }
50+ }
Original file line number Diff line number Diff line change 1+ # 开始实现配置我们的 uwsgi 的配置文件
2+ # 使用 nginx 链接的时候,django 程序实现连接的服务器地址就是当前的 linux 系统 ip地址
3+ [uwsgi]
4+ socket = 192.168.183.128: 8001
5+
6+ # 开始实现配置项目根目录
7+ chdir = /home/juwenzhang/桌面/python_bbs
8+
9+ # 然后配置 uwsgi 文件的相对路径
10+ wsgi-file = python_bbs/wsgi.py
11+
12+ # 进程数
13+ processes = 10
14+
15+ # 线程数
16+ threads = 5
17+
18+ # 服务器角色
19+ master = true
20+
21+ # 存放进程比编号文件——自动创建
22+ pidfile = uwsgi.pid
23+
24+ # 日志文件——自动创建
25+ daemonize = logs/uwsgi.log
You can’t perform that action at this time.
0 commit comments