Tangible Bytes

A Web Developer’s Blog

Local https for dev

As more and more of the web moves to https, we developers find more problems getting things to run properly.

It used to be easier to run development sites on http and maybe have a config option pretending it was secure, or use a fake certificate (often labelled “snakeoil”)

As the internet has matured this has become more problematic.

Some things just don’t work without https, browsers are less likely to let you ignore the warning, and if you develop a PWA it just won’t work without a valid, trusted certificate.

SSL Warning

Read more ...

Wildcard Proxy

I have a client who need to spin up webservers on demand to quickly test code and content, they use Docker to host these sites.

Currently they expose each site an a different port - which needs to be configured both within the container so that it can perform appropriate redirects, and by the user needing to get to the right site.

I’m automating the spin up process and wanted to make this a bit smoother.

I like to use wildcard DNS for ephemeral servers such as these.

A wildcard DNS record is a record in a DNS zone that will match requests for non-existent domain names.

A wildcard DNS record is specified by using a * as the leftmost label (part) of a domain name, e.g. *.example.com.

wikipedia

I just point this address at my Docker server and then any name like website1.testsites.example.com will resolve to my docker host.

Read more ...