JaeYeopHan / tip-archive

📦 Archiving various development tips. If you watch this repository, you can get issues related to the newly registered development tip from the GitHub feed.
https://www.facebook.com/Jbee.dev/
245 stars 8 forks source link

Trailing slash? #65

Open JaeYeopHan opened 4 years ago

JaeYeopHan commented 4 years ago

trailing slash를 붙여지는 것처럼 보이는 케이스는 두 경우이다.

브라우저에서 붙이는 경우

url hostname 다음 path에 아무것도 없을 때 /를 붙여주게 된다. path가 없을 수 없기 때문이다.

Nginx에서 붙이는 경우

nginx에서 request를 받고 이 부분을 302 Permanant redirect 했을 때, 브라우저에서 trailing slash 로 응답을 받아 붙여지는 것처럼 보이는 경우다.

URL 끝에 '/' 는 왜 붙이는 걸까?