mirror of
https://github.com/danog/sass-site.git
synced 2024-11-30 04:29:17 +01:00
652e48b022
Since we're now serving the website fully statically, we need to use meta redirects rather than relying on our server configuration. Closes #650
19 lines
489 B
Ruby
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")
|