Skip to content

Proxy Server

Source: Notion | Last edited: 2024-12-11 | ID: 1592d2dc-3ef...


  1. Create an ec2, assign elastic ip to that instance.
  2. ssh to the instance, install Squid proxy, following the instruction: https://ubuntu.com/server/docs/how-to-install-a-squid-server
Terminal window
sudo apt update
sudo apt install squid -y
# make a copy of the original and protect it from writing
sudo cp /etc/squid/squid.conf /etc/squid/squid.conf.original
sudo chmod a-w /etc/squid/squid.conf.original
# Configure Squid, make the squid.conf as follows:
ubuntu@ip-172-31-20-191:~$ cat /etc/squid/squid.conf
# Allow traffic only from the trading server
acl trading_server src 172.31.21.165
http_access allow trading_server
# Deny all other traffic
http_access deny all
# Set up the proxy to listen on default port 3128
http_port 3128
# Restart Squid service
sudo systemctl restart squid
# Check status
sudo systemctl status squid

After running these commands, your Squid proxy server will be:

  • Installed and configured with basic security settings
  • Running on port 3128
  • Set to start automatically on system boot
  • Allowing access from trading server