ruby-on-rails 设置-轨道7中的Cookie标头错误地设置为数组

5vf7fwbs  于 12个月前  发布在  Ruby
关注(0)|答案(1)|浏览(119)

所以,我最近创建了一个rails 7.1应用程序,遇到了这个奇怪的事情:头没有正确设置。它看起来像Set-Cookie头,而不是重复cookie数组的每个元素,它被追加一次,它的值是cookie数组本身,奇怪的是:

["_myapp_session

字符串
作为key,其余的作为value。
有没有什么方法可以解决这个问题?我该如何解决这个问题?
NGINX conf:

server {
  #listen [::]:443 ssl ipv6only=on;
  listen 443 ssl;
  ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem;
  ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem;
  include /etc/letsencrypt/options-ssl-nginx.conf;
  ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;

  server_name example.com;
  root /home/path/to/app/public;

  passenger_enabled on;
  passenger_app_env production;

  location /cable {
    passenger_app_group_name myapp_websocket;
    passenger_force_max_concurrent_requests_per_process 0;
  }

  client_max_body_size 100m;

  location ~ ^/(assets|packs) {
    expires max;
    gzip_static on;
  }
}
server {
  if ($host = example.com) {
    return 301 https://$host$request_uri;
  }

  listen 80;
  listen [::]:80;

  server_name example.com;
  return 404;
}

server {
  listen 80;
  listen [::]:80;

  listen 443 ssl;
  listen [::]:443 ssl;

  server_name www.example.com;
  return 301 https://example.com;
}


Ruby 3.0.2 rails 7.1.1 nginx + passengers

abithluo

abithluo1#

Passenger与Rack 3还不兼容,您可以降级到Rack 2,同时继续使用Rails 7.1,方法是将以下内容添加到您的Gemfile

gem "rack", "< 3"

字符串
您也可以等待Passenger的新版本发布(6.0.19),该版本增加了对Rack 3头数组的支持(https://github.com/phusion/Buller/blob/b4c3921de29b3fa6aaa0d300fb06df67f12df698/CHANGELOG#L3)

相关问题