打包后,上传到服务器,webman-admin 后台登陆验证码session获取不到,可以正确设置,但是拿不到session的值,不知道是什么原因呢?相同的nginx 配置,在其它端是可以正确设置获取到session的。
upstream webmanapi {
server 172.31.34.153:8787;
keepalive 10240;
}
server{
listen 80;
listen [::]:80;
listen 443 ssl http2;
listen [::]:443 ssl http2;
ssl_certificate /usr/local/nginx/conf/ssl/aaa.crt;
ssl_certificate_key /usr/local/nginx/conf/ssl/aaa.key;
ssl_protocols TLSv1.2 TLSv1.3;
ssl_conf_command Options PrioritizeChaCha;
ssl_prefer_server_ciphers on;
ssl_session_timeout 10m;
ssl_session_cache shared:SSL:10m;
ssl_buffer_size 2k;
add_header Strict-Transport-Security max-age=15768000;
ssl_stapling on;
ssl_stapling_verify on;
server_name aaa.com;
access_log off;
index index.html index.htm index.php;
root /data/wwwroot/aaa;
if ($ssl_protocol = "") { return 301 https://$host$request_uri; }
location / {
add_header 'Access-Control-Allow-Origin' $http_origin;
add_header 'Access-Control-Allow-Credentials' 'true';
add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, DELETE, PATCH, OPTIONS';
add_header 'Access-Control-Allow-Headers' 'DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization,Authorization-admin,token';
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_http_version 1.1;
proxy_set_header Connection "";
if (!-f $request_filename){
proxy_pass http://webmanapi;
}
}
}
session是基于cookie的,session获取不到一般是cookie没有设置成功,或者cookie没有传递给服务端。
浏览器里network里看 cookie PHPSID是否有正确设置和传递给服务端
直接走webman试下,看下能不能拿到session,如果能可能是nginx代理环节有问题。
https://www.workerman.net/q/9465