bingo: serve bingo.asxp.io too, credit asxp.io in footer
datacenterbingo.xyz is not in the .xyz zone yet, while bingo.asxp.io already resolves. Serve the card on both (BINGO_ALT_HOST) so it is reachable now; canonical and hreflang links keep pointing at the .xyz domain. Footer gets a copyright line linking back to asxp.io. Assisted-by: Claude:opus-5
This commit is contained in:
parent
90e1bbc9c5
commit
cd04b01e57
7 changed files with 22 additions and 9 deletions
13
config.ru
13
config.ru
|
|
@ -2,16 +2,19 @@ require 'sinatra/base'
|
|||
require './asxpio.rb'
|
||||
require './bingo_web.rb'
|
||||
|
||||
# One process, two sites: BINGO_HOST gets the bingo, everything else asxp.io.
|
||||
asxpio = AsxpioWeb.new
|
||||
bingo = BingoWeb.new
|
||||
bingo_host = ENV['BINGO_HOST']
|
||||
# One process, two sites: the bingo hosts get BingoWeb, everything else
|
||||
# asxp.io. BINGO_HOST is canonical (www. redirects to it); BINGO_ALT_HOST
|
||||
# serves the same card, e.g. while the canonical domain's DNS settles.
|
||||
asxpio = AsxpioWeb.new
|
||||
bingo = BingoWeb.new
|
||||
bingo_host = ENV['BINGO_HOST']
|
||||
bingo_hosts = BingoWeb::HOSTS
|
||||
|
||||
run lambda { |env|
|
||||
req = Rack::Request.new(env)
|
||||
if bingo_host && req.host == "www.#{bingo_host}"
|
||||
[301, { 'location' => "https://#{bingo_host}#{req.fullpath}" }, []]
|
||||
else
|
||||
(bingo_host && req.host == bingo_host ? bingo : asxpio).call(env)
|
||||
(bingo_hosts.include?(req.host) ? bingo : asxpio).call(env)
|
||||
end
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue