sass-site/config.ru
Natalie Weizenbaum 652e48b022
Fix redirects (#649)
Since we're now serving the website fully statically, we need to use
meta redirects rather than relying on our server configuration.

Closes #650
2022-06-22 16:44:37 -07:00

19 lines
489 B
Ruby

require "rubygems"
require "rack/conditional"
require "rack/rewrite"
require "rack/ssl"
require "rack/contrib/not_found"
require "rack/contrib/try_static"
# Make sure we don't force SSL on domains that don't have SSL certificates.
use Rack::Conditional, proc {|env| env["SERVER_NAME"] == "sass-lang.com"}, Rack::SSL
use Rack::Deflater
use Rack::TryStatic,
urls: ["/"], root: 'build', index: 'index.html',
try: ['.html', '/index.html']
run Rack::NotFound.new("build/404.html")