Ricevo un'intestazione o un cookie di richiesta di richiesta di errore 400 troppo grande da nginx con la mia app Rails. Il riavvio del browser risolve il problema. Sto solo memorizzando un ID stringa nel mio cookie, quindi dovrebbe essere piccolo.400 Richiesta errata - intestazione richiesta o cookie troppo grande
Dove posso trovare i log degli errori di nginx? Ho dato un'occhiata a nano /opt/nginx/logs/error.log, ma non ha nulla di relativo.
ho cercato di impostare segue e senza fortuna:
location/{
large_client_header_buffers 4 32k;
proxy_buffer_size 32k;
}
nginx.conf
#user nobody;
worker_processes 1;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;
events {
worker_connections 1024;
}
http {
passenger_root /home/app/.rvm/gems/ruby-1.9.3-p392/gems/passenger-3.0.19;
passenger_ruby /home/app/.rvm/wrappers/ruby-1.9.3-p392/ruby;
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
client_max_body_size 20M;
server {
listen 80;
server_name localhost;
root /home/app/myapp/current/public;
passenger_enabled on;
#charset koi8-r;
#access_log logs/host.access.log main;
# location/{
# large_client_header_buffers 4 32k;
# proxy_buffer_size 32k;
# }
# location/{
# root html;
# index index.html index.htm;
# client_max_body_size 4M;
# client_body_buffer_size 128k;
# }
#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;
}
# proxy the PHP scripts to Apache listening on 127.0.0.1:80
#
#location ~ \.php$ {
# proxy_pass http://127.0.0.1;
#}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
#location ~ \.php$ {
# root html;
# fastcgi_pass 127.0.0.1:9000;
# fastcgi_index index.php;
# fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
# include fastcgi_params;
#}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
}
# another virtual host using mix of IP-, name-, and port-based configuration
#
#server {
# listen 8000;
# listen somename:8080;
# server_name somename alias another.alias;
# location/{
# root html;
# index index.html index.htm;
# }
#}
# HTTPS server
#
#server {
# listen 443;
# server_name localhost;
# ssl on;
# ssl_certificate cert.pem;
# ssl_certificate_key cert.key;
# ssl_session_timeout 5m;
# ssl_protocols SSLv2 SSLv3 TLSv1;
# ssl_ciphers HIGH:!aNULL:!MD5;
# ssl_prefer_server_ciphers on;
# location/{
# root html;
# index index.html index.htm;
# }
#}
}
Ecco il mio codice di memorizzazione dei cookie e uno screenshot dei biscotti in Firebug. Ho usato firebug per controllare la sessione memorizzata e ho trovato New Relic e jQuery sta memorizzando anche i cookie; potrebbe essere il motivo per cui la dimensione del cookie è stata superata?
def current_company
return if current_user.nil?
session[:current_company_id] = current_user.companies.first.id if session[:current_company_id].blank?
@current_company ||= Company.find(session[:current_company_id])
end
Quanti dati si memorizzano in sessione? –
Si prega di mostrare la parte di codice che memorizza i dati nel cookie. –