![컬을 사용하여 URL에 액세스할 수 있지만 Google 크롬 브라우저에서는 실패하는 이유는 무엇입니까?](https://linux55.com/image/199640/%EC%BB%AC%EC%9D%84%20%EC%82%AC%EC%9A%A9%ED%95%98%EC%97%AC%20URL%EC%97%90%20%EC%95%A1%EC%84%B8%EC%8A%A4%ED%95%A0%20%EC%88%98%20%EC%9E%88%EC%A7%80%EB%A7%8C%20Google%20%ED%81%AC%EB%A1%AC%20%EB%B8%8C%EB%9D%BC%EC%9A%B0%EC%A0%80%EC%97%90%EC%84%9C%EB%8A%94%20%EC%8B%A4%ED%8C%A8%ED%95%98%EB%8A%94%20%EC%9D%B4%EC%9C%A0%EB%8A%94%20%EB%AC%B4%EC%97%87%EC%9E%85%EB%8B%88%EA%B9%8C%3F.png)
macOS의 nginx에서 localhost URL을 다음과 같이 구성합니다.
➜ nginx git:(master) cat conf.d/reddwarf-admin.conf
server {
listen 8083;
server_name admin.reddwarf.com;
location / {
proxy_pass http://127.0.0.1:3000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
}
location ^~ /service/ {
proxy_pass https://admin.example.top/;
proxy_redirect off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
그런 다음 다음에서 로컬 도메인을 구성합니다 /etc/hosts
.
127.0.0.1 admin.reddwarf.com
다음과 같이 터미널에서 명령을 사용하여 네트워크를 가져옵니다.
curl http://admin.reddwarf.com:8083
HTML을 성공적으로 가져옵니다. 다음 단계에서는 Google Chrome에서 URL을 가져오면 오류가 표시됩니다.
This page isn’t workingadmin.reddwarf.com is currently unable to handle this request.
HTTP ERROR 502
내가 뭐 놓친 거 없니? 터미널과 Google 크롬에서 액세스할 수 있게 하려면 어떻게 해야 합니까? 이것은 내 macOS DNS 구성입니다.
➜ ~ cat /etc/resolv.conf
#
# macOS Notice
#
# This file is not consulted for DNS hostname resolution, address
# resolution, or the DNS query routing mechanism used by most
# processes on this system.
#
# To view the DNS configuration used by this system, use:
# scutil --dns
#
# SEE ALSO
# dns-sd(1), scutil(8)
#
# This file is automatically generated.
#
nameserver 192.168.31.1
192.168.x.x
로컬 네트워크 IP 주소를 사용하여 포트에 액세스할 수 있습니다.