book-of-kubernetes / examples

Examples for The Book of Kubernetes
MIT License
146 stars 71 forks source link

Todo URL appears incorrect #6

Closed petermcd closed 1 year ago

petermcd commented 1 year ago

When installing the todo project the Ansible script outputs the following message:

ok: [host01] => {
    "msg": "Once your Kubernetes cluster is up, you can access the todo application at http://localhost:4808                                                                                                                                 0/todo"
}

Attempting to connect to this url results in:

peter@Elk:~$ wget http://127.0.0.1:48080/todo
--2022-09-14 22:27:08--  http://127.0.0.1:48080/todo
Connecting to 127.0.0.1:48080... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: /todo/ [following]
--2022-09-14 22:27:08--  http://127.0.0.1:48080/todo/
Reusing existing connection to 127.0.0.1:48080.
HTTP request sent, awaiting response... 502 Bad Gateway
2022-09-14 22:27:08 ERROR 502: Bad Gateway.

However adding a trailing slash makes it work:

peter@Elk:~$ wget http://127.0.0.1:48080/todo/
--2022-09-14 22:35:20--  http://127.0.0.1:48080/todo/
Connecting to 127.0.0.1:48080... connected.
HTTP request sent, awaiting response... 200 OK
Length: 2714 (2.7K) [text/html]
Saving to: ‘index.html’

index.html                 100%[========================================>]   2.65K  --.-KB/s    in 0s

2022-09-14 22:35:20 (127 MB/s) - ‘index.html’ saved [2714/2714]
petermcd commented 1 year ago

Just realised this was caused by me using 127.0.0.1 but it was also caused by me trying the same url but replacing with my devices internal network IP in a browser. Adding the trailing slash worked in eaxh case.