Site issues when using zero-downtime deployments with Nginx

You may face an issue whereby following a new zero-downtime deployment, your web server will serve an older (the previous) version of your code to visitors. Specifically, this can happen if you're using Nginx as your web server.

It is suggested that even when Nginx is set to serve your site from the current symlink, it can still cache the old release directory.

Adding the following to your config should ensure that Nginx always serves the correct, latest release to visitors.

fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
fastcgi_param DOCUMENT_ROOT $realpath_root;

Proudly powered by Katapult. Running on 100% renewable energy.