LoginSignup
2
0

More than 5 years have passed since last update.

[メモ]Squid で Proxy サーバーを立てて Proxy 経由でアクセスする

Posted at

メモ。
AmazonLinux2 を使って squid をインストールし、squid を経由してアクセスしてみたときのメモ

Proxy(Squid)

# install と起動、自動起動設定
$sudo yum install squid
$sudo systemctl start squid
$systemctl enable squid
Created symlink from /etc/systemd/system/multi-user.target.wants/squid.service to /usr/lib/systemd/system/squid.service.

# デフォルトは 3128 で listenしている
$cat /etc/squid/squid.conf |grep 3128
# Squid normally listens to port 3128
http_port 3128

これで OK.
アクセスログは以下を監視する。

$tail -f /var/log/squid/access.log

クライアント側

以下のような感じで Proxy を経由してリクエスト

$curl -vvv --proxy http://[squid private IP]:3128 https://www.google.co.jp

これで Proxy のアクセスログが記録され、レスポンスも返却される
クライアントは PrivateSubnet に配置して Proxy 経由でリクエストするとかが可能

2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0