Category / NGINX

RAILS SERVE STATIC FILES with NGINX


Rails 4.2+ has introduced an environment variable in production ENV['RAILS_SERVE_STATIC_FILES'] which disallows serving static files and assets by default.

1
2
3
# Disable serving static files from the `/public` folder by default since
# Apache or NGINX already handles this.
config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present...
Read More