Skip to content

Instantly share code, notes, and snippets.

@rally25rs
rally25rs / nginx_rails_sendfile.md
Last active Mar 26, 2019
nginx rails send_file madness
View nginx_rails_sendfile.md

Goal: Have some static content, served by Nginx, but it requires an authenticated user. User auth is through Rails.

Project structure: The actual static files are in /home/vagrant/docs/ The browser will use the URL /help/* to access this content

The Ruby bits: RAILS_ENV=production rails server is used to start a WEBrick on port 3000.

config/environments/production.rb

You can’t perform that action at this time.