The first line of every HTTP answer holds a status code: what happened to the request. 2xx went fine, 3xx sends you elsewhere, 4xx means the request was wrong, 5xx means the server side failed.
| Code | Means | Look at |
|---|---|---|
| 200 OK | here it is | nothing wrong |
| 301 Moved Permanently | it's somewhere else: the Location header says where | the new address |
| 404 Not Found | no such page | the URL |
| 502 Bad Gateway | the server in front is up, but couldn't get an answer from the app behind it | the app |
| 503 Service Unavailable | the server can't serve it right now: overloaded, in maintenance, or nothing ready behind it | the server, then what's behind it |
New command
curl -I
Asks for the status line and headers only, without the page.
Usagecurl -I url
text
learner@ops:~$ curl -I http://web/old-shop
HTTP/1.1 301 Moved Permanently
Server: nginx/1.24.0 (Ubuntu)
…
Location: https://shop.monster.market/ ← go here insteadObjectives
- Where /old-shop went.
- What a 502 says is down.
- Bring the page back.