The grand design is the following:
You should be able to fix this by replacing localhost with a wildcard:
localhost