Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Host blocks don't appear to work? #55

Open
dragonpaw opened this issue Mar 28, 2020 · 0 comments
Open

Host blocks don't appear to work? #55

dragonpaw opened this issue Mar 28, 2020 · 0 comments

Comments

@dragonpaw
Copy link

Recently I was trying to put together a docker container (based on labstack/armor:0.4.14) for several static sites, but no matter what I did, the hosts sections didn't seem to be getting read:

Simplified config:

address: :80
plugins:
  - name: logger
  - name: remove-trailing-slash
    redirect_code: 301
hosts:
  dragonpaw.org:
    paths:
      "/":
        plugins:
        - name: static
          root: "/"
          browse: true

Using httpie to test:

$ http http://localhost:80/ Host:dragonpaw.org --verbose
GET / HTTP/1.1
Accept: */*
Accept-Encoding: gzip, deflate
Connection: keep-alive
Host: dragonpaw.org
User-Agent: HTTPie/0.9.8



HTTP/1.1 404 Not Found
Content-Length: 24
Content-Type: application/json; charset=UTF-8
Date: Sat, 28 Mar 2020 23:47:28 GMT
Server: armor/0.4.14

{
    "message": "Not Found"
}

And the same on the console:
{"time":"2020-03-28T23:47:28.977242512Z","id":"","remote_ip":"172.18.0.1","host":"dragonpaw.org","method":"GET","uri":"/","user_agent":"HTTPie/0.9.8","status":404,"error":"code=404, message=Not Found","latency":28600,"latency_human":"28.6µs","bytes_in":0,"bytes_out":24}

The hostname matches what's in the config, and a browseable / shouldn't give a 404, no matter what.

So what am I missing?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant