Solved: NginX serving different localhost sites to Chromium vs. Safari or Firefox

I ran into a weird problem testing some websites on a local NginX installation on my Mac, where it was sending different sites to Firefox and Chrome for the same URL.

I’d put the server names into /etc/hosts pointing to 127.0.0.1, and I’d set up NginX with multiple server {} blocks, each with a different server_name. But while Chrome would load the individual sites for one.example.com and two.example.com, Firefox would always get the content from one.example.com.

A little more testing confirmed that all Chromium-based web browsers (I tried Edge, Opera, Brave and Vivaldi) were getting the correct sites, but Firefox and Safari were both getting the wrong server’s content.

When I compared the server blocks, I noticed that one.example.com was listening on both IPv4 and IPv6, but two.example.com was listening only on IPv4. I added the second listen directive, reloaded nginx, and voila! It worked in Firefox and Safari!

    listen 443 ssl;
    listen [::]:443 ssl;
    server_name  two.example.com;

So apparently, even though I’d only pointed two.example.com to 127.0.0.7 (IPv4), Firefox and Safari were connecting to ::1 (IPv6) instead. And since NginX had only connected one.example.com to that interface, that’s the site it loaded. It’s not clear whether Firefox and Safari are both doing something weird and Chrome isn’t, or they’re both using a MacOS system resolver and Chromium is doing its own thing.

TL;DR: If you listen to IPV6 in one localhost server {} block, listen to it in all of them!

So. Much. Sanitizer.

Remember last year when it was virtually impossible to get hand sanitizer? You couldn’t order it online, you couldn’t order it for an in-store pickup, and stores that had it were limiting how many of those tiny bottles each customer could buy? Breweries and distilleries were stepping in to supplement the supply, but it still wasn’t enough.

I mean, I don’t like to leave my camera visible in the car when I park, but for a while, I was more worried about leaving a two-ounce bottle of hand sanitizer where it could be seen.

Heck, when I found an 8-ounce bottle at Target in May 2020, I snapped a photo to send it home!

Holding a bottle of hand sanitizer in front of a store shelf with a sign saying that customers are limited to one bottle each due to high demand.

Times have changed.

Factory lines got up to speed after a few months. We bought extra to make sure we wouldn’t run out. Then we learned that Covid spreads more by sharing air than by touching surfaces. And a third of the population convinced themselves it wasn’t a problem, while half to two thirds of the population have gotten at least partly vaccinated against it. And after a year with multiple waves of cases, the rates are currently waaaaaay down in California.

And we’re all so tired of it all.

And we don’t need as much hand sanitizer as we thought we were going to a year ago.

This is the same store this week. Four rolling shelf units and at least one section of the wall shelving. Full.

Shelves and shelves and rolling carts full of hand sanitizer bottles.

So, um, anybody want to buy some hand sanitizer?

Hungry Hawk

As soon as I stepped out the door for a walk this morning, I heard a lot of crows making a huge racket down the street. They were perched on a telephone pole, flying up and swooping around like they were trying to scare off a hawk.

Of course I walked toward them to see what was going on.

A telephone pole with at least 15 crows perched on the cross piece and wires, seen from below with the wires and crosspiece forming diagonals.

By the time I reached the end of the block, the crows had given up and flown off. But I noticed people were out in their front yards looking up at a tree. It turns out the crows had been trying to scare off a hawk that had killed a pigeon and settled into the tree to eat it. At first I could only see the occasional feather raining down, until I moved to where I could see through a gap in the branches. Continue reading