<div dir="ltr">Hello,We become indebted to.<br><br>If anyone is familiar with setting up squid in a linux environment, please let me know.<br><br>I want to access the URL of the actual site in the test environment that I do not want to connect to the production environment.<br>Specifically, I want to be able to control it with a file like /etc/hosts.<br><br>I am building a docker container and<br>For access on the docker container server<br>I want it to be a successful move.<br><br>----<br>Example: <a href="http://AAA.optim.co.jp">AAA.optim.co.jp</a> is actually registered in DNS, so<br>The IP address of the production <a href="http://AAA.optim.co.jp">AAA.optim.co.jp</a> site is referenced.<br>Therefore, I am trying to rewrite the hosts file on the docker container server.<br><br>### For <a href="http://AAA.optim.co.jp">AAA.optim.co.jp</a>, set to refer to your own server<br>$ docker exec -it ci_app_1 bash<br># vi /etc/hosts<br>172.17.0.1 <a href="http://AAA.optim.co.jp">AAA.optim.co.jp</a><br><br><br>However, when I actually hit the URL, I get a 503.<br>$ docker exec -it ci_app_1 bash<br># curl -G -I "<a href="https://AAA.optim.co.jp/~">https://AAA.optim.co.jp/~</a>"<br><br>HTTP/1.1 200 Connection established<br><br>HTTP/1.1 503 Service Unavailable<br>Server: nginx<br>Date: Tue, 23 May 2023 08:04:30 GMT<br>Content-Type: application/json; charset=utf-8<br>Status: 503 Service Unavailable<br>X-Frame-Options: SAMEORIGIN<br>X-XSS-Protection: 1; mode=block<br>X-Content-Type-Options: nosniff<br>Cache-Control: no-cache<br>X-Request-Id: c690bd75-750b-4985-937f-2ac566d3b09f<br>X-Runtime: 0.004765<br>X-Cache: MISS from ip-10-0-3-217.ap-northeast-1.compute.internal<br>X-Cache-Lookup: MISS from ip-10-0-3-217.ap-northeast-1.compute.internal:3128<br>Via: 1.1 ip-10-0-3-217.ap-northeast-1.compute.internal (squid/3.5.20)<br>Connection: keep-alive<br><br>If you look at the Squid logs, it goes to see the production site address registered in DNS.<br>1684829160.806 135 172.17.0.2 TAG_NONE/200 0 CONNECT <a href="http://AAA.optim.co.jp:443">AAA.optim.co.jp:443</a> - HIER_DIRECT/AAA.AAA.AAA.AAA -<br>1684829160.838 28 172.17.0.2 TCP_MISS/503 600 HEAD <a href="https://aaa.optim.co.jp/%EF%BD%9E">https://AAA.optim.co.jp/~</a> - HIER_DIRECT/AAA.AAA.AAA.AAAapplication/json<br><br>----<br><br>what i want to do<br><br>・If you want to access the <a href="https://AAA.optim.co.jp/">https://AAA.optim.co.jp/</a> site via Squid, you want to refer to /etc/hosts of your own host instead of DNS.<br>In short, in case of access to a specific domain, can't it be separated so that it refers to the hosts file without using DNS?<br>Is it possible to divide the reference destination of name resolution for each domain in Squid? about it.<br><br>We apologize for the inconvenience, but thank you in advance.<br></div>