I have Rails4 application running in production, and my visitors run occasionally into ActionController::InvalidAuthenticityToken error, which I cant reproduce. I get 2-4 daily
I had same trouble. Server: nginx + passenger
nginx.conf:
http {
...
expires 90d;
...
server {
server_name domain1.com
...
}
server {
server_name domain2.com
...
}
server {
server_name domain_3_with_rails.com
...
}
}
Problems in instruction "expires 90d;" Browser locally cached page with form and with authenticity_token.
Solution: add "expires 0d;"
for rails domains:
nginx.conf:
http {
...
expires 90d;
...
server {
server_name domain1.com
...
}
server {
server_name domain2.com
...
}
server {
server_name domain_3_with_rails.com
expires 0d;
...
}
}
After that, be sure to restart Nginx.
For those who have apache: apache it certainly has a similar statement "expires" for nginx