论坛有相关教程,你可以自行查阅一下
没有域名,只有ip地址,使用nginx配置有优化效果吗,还是说没必要
hello,我也想在1panel中使用这段配置,但是一直报错,不知道你最后咋配置的
借助于chatGPT终于弄好了
server {
listen 80 ;
listen 443 ssl http2 ;
server_name chat.xxx.com;
index index.php index.html index.htm default.php default.htm default.html;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $server_name;
proxy_set_header X-Real-IP $remote_addr;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $http_connection;
# 其他安全头部
add_header X-Frame-Options SAMEORIGIN;
add_header X-Content-Type-Options nosniff;
add_header X-XSS-Protection "1; mode=block";
add_header Referrer-Policy "strict-origin-when-cross-origin";
access_log /www/sites/chat.xxx.com/log/access.log main;
error_log /www/sites/chat.xxxx.com/log/error.log;
location ^~ /.well-known/acme-challenge {
allow all;
root /usr/share/nginx/html;
}
include /www/sites/chat.xxx.com/proxy/*.conf;
if ($scheme = http) {
return 301 https://$host$request_uri;
}
ssl_certificate /www/sites/chat.xxx.com/ssl/fullchain.pem;
ssl_certificate_key /www/sites/chat.xxx.com/ssl/privkey.pem;
ssl_protocols TLSv1.3 TLSv1.2 TLSv1.1 TLSv1;
ssl_ciphers ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA256:!aNULL:!eNULL:!EXPORT:!DSS:!DES:!RC4:!3DES:!MD5:!PSK:!KRB5:!SRP:!CAMELLIA:!SEED;
ssl_prefer_server_ciphers on;
ssl_session_cache shared:SSL:10m;
ssl_session_timeout 10m;
error_page 497 https://$host$request_uri;
proxy_set_header X-Forwarded-Proto https;
# 优化代理缓冲
proxy_buffering on;
proxy_buffer_size 128k;
proxy_buffers 4 256k;
proxy_temp_file_write_size 512k;
proxy_busy_buffers_size 256k;
# 优化代理超时设置
proxy_connect_timeout 60s;
proxy_send_timeout 60s;
proxy_read_timeout 60s;
add_header Strict-Transport-Security "max-age=31536000";
}
4 个赞
用宝塔的话,直接去宝塔里面把网站的配置换了吗?
1 个赞
请教一下大佬:上述的‘Api_URL为api站点地址和Chat_URL为对话站点地址’,分别指的是大模型的api地址和open webui的对话api地址吗?
1 个赞
对,是的!