Skip to content

[Icebox] : 웹서버 127.0.0.1과 0.0.0.0이 같은포트에 함께 열려있는 경우 #80

@exgs

Description

@exgs

문제점
해결해야하는 문제점은 아니라고 생각함.
같은 포트번호(=8000) 그리고 host가 하나는 0.0.0.0이고 다른 하나는 127.0.0.1 일 때,
postman으로 127.0.0.1:8000 접근하면, 127.0.0.1:8000번으로 들어감.
만약 host:127.0.0.1 port:8000을 config파일에 구성하지 않았다면, 0.0.0.0:8000으로 들어감.

예상되는(제대로 된) 동작
0.0.0.0은 열려있는 모든 inet에 대해서 받아줄 수 있기 때문에 헷갈릴 수 있으나, 우리 웹서버에서는 명시적으로 써준 서버소켓이
있으면, 그쪽으로 연결된다.

버그 재현 방법(버그를 발생시키는 방법)

server
{
	port 8002
	host 0.0.0.0
	error_page error.html
	index_pages 2index.html
	autoindex on
	timeout 200
}
server
{
	port 8002
	host 127.0.0.1
	error_page error.html
	index_pages index.html
	autoindex off
	timeout 200
}

위와 같은 구성의 .config 으로 돌려보면 확인 할 수 있음.

Metadata

Metadata

Assignees

No one assigned

    Labels

    ICEBOXbugSomething isn't workingwontfixThis will not be worked on

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions