Closed simonw closed 2 years ago
I'm also going to extract the Apache config files from https://github.com/simonw/datasette/blob/250db8192cb8aba5eb8cd301ccc2a49525bc3d24/demos/apache-proxy/Dockerfile into a separate file to make it easier to read.
(The supervisor config needs to be dynamically constructed to include $DATASETTE_REF so I will leave it where it is.)
I pointed CNAME
of datasette-apache-proxy-demo.datasette.io
at datasette-apache-proxy-demo.fly.dev.
using Vercel DNS:
Then I asked Fly to issue a LetsEncrypt certificate for that:
% flyctl certs create datasette-apache-proxy-demo.datasette.io
# About 53 seconds later:
% flyctl certs show datasette-apache-proxy-demo.datasette.io
The certificate for datasette-apache-proxy-demo.datasette.io has been issued.
Hostname = datasette-apache-proxy-demo.datasette.io
DNS Provider = constellix
Certificate Authority = Let's Encrypt
Issued = ecdsa,rsa
Added to App = 53 seconds ago
Source = fly
https://datasette-apache-proxy-demo.datasette.io/ works now - I'll use that in the documentation.
I noticed that http://datasette-apache-proxy-demo.datasette.io/
wasn't redirecting to https
so I built a new plugin: https://github.com/simonw/datasette-redirect-to-https
% curl -i 'http://datasette-apache-proxy-demo.datasette.io/prefix/fixtures/no_primary_key'
HTTP/1.1 301 Moved Permanently
date: Sat, 20 Nov 2021 23:22:50 GMT
server: Fly/51d150d (2021-11-19)
location: https://datasette-apache-proxy-demo.datasette.io/fixtures/no_primary_key
x-proxied-by: Apache2 Debian
transfer-encoding: chunked
via: 1.1 fly.io
fly-request-id: 01FMZTHTHVPC8BZY0625D7JV4B
Originally posted by @simonw in https://github.com/simonw/datasette/issues/1519#issuecomment-974697824
I'm going to put out 0.59.3 bugfix release with this, but I'd like to first improve the documentation on https://docs.datasette.io/en/stable/deploying.html#apache-proxy-configuration to highlight the new demo.