在Amazon每年白嫖一年EC2服务器已经有些年头了,一开始我是为了给GAE应用作一个反向代理,后来就是纯粹搭建一个什么都没有的服务器,纯粹转发socks5流量,为了偶尔科学上网使用。其实不太好用了,有时候自己都连不上,我基本都不怎么用了。

步骤:

地区:大阪

实例名称:随便填,我填了myEC2

AMI按默认:Amazon Linux,Amazon Linux 2023内核-6.1AMI,64位(X86)

实力类型,按默认最便宜的t3.micro

密钥对:名称随便填,ED25519,pem

网络设置:选中现有安全组,其它按默认。默认安全组是允许所有流量。

存储配置:按默认8GiB gp3

启动实例

到EC2控制面板,勾选正在运行的实例,点击连接,SSH客户端,你可以看到连接的用户名和连接的IP或地址

发现用官方网页ssh连接和本地security配置的连接都无法连接ssh,这里就不介绍怎么连了。

于是手动新建0.0.0.0支持能出入证ssh、hht、https,建立后可以ssh连接上了。 至此,就可以用ssh联网科学上网了。

以下是我的其他额外配置,很多配置对我没用了,但我还是继续配一下

  1. 安装nginx

安装:sudo yum install nginx -y 启动:sudo systemctl start nginx 自启:sudo systemctl enable nginx 验证:sudo systemctl status nginx

sudo vi /etc/nginx/nginx.conf #yobin added 20151113 begin upstream ghs { ip_hash; server ghs.google.com; #server 74.125.31.121; }

server {
  listen 80;
  server_name *.xxxxx.com;
  #access_log /var/log/nginx/ghs.log;

location /{
        proxy_redirect off;
        proxy_set_header Host $host;
        proxy_pass http://ghs;
        proxy_set_header  x-real-IP  $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
      }
 }
 #yobin added 20151113 end
  1. 216.198.79.1dnspod配置 登录了dnspod,发现我已经彻底放弃gae应用了,目前就挂了个vercel、resend、improvmx和Google Search