[root@MiWiFi-R1CM-srv ~]# yum install privoxy
[root@MiWiFi-R1CM-srv privoxy]# cd /etc/privoxy/
[root@MiWiFi-R1CM-srv privoxy]# touch pac.action
[root@MiWiFi-R1CM-srv privoxy]# vim pac.action
####pac.action#####
{{alias}}
default = +forward-override{forward .}
pac = +forward-override{forward 10.0.8.253:8118}
{default}
/
{pac}
10.96.4.187
#########################
[root@MiWiFi-R1CM-srv privoxy]# vim config
####config#####
# 添加自定义的PAC规则
actionsfile pac.action
# 下面这几行是系统预定义的转发规则,注释掉
# actionsfile match-all.action # Actions that are applied to all sites and maybe overruled later on.
# actionsfile default.action # Main actions file
# actionsfile user.action # User customizations
# 下面这几行是系统预定义的过滤规则,注释掉
# filterfile default.filter
# filterfile user.filter # User customizations
#########################
[root@MiWiFi-R1CM-srv ~]# service privoxy start
Redirecting to /bin/systemctl start privoxy.service
You have new mail in /var/spool/mail/root
[root@MiWiFi-R1CM-srv ~]# service privoxy status
Redirecting to /bin/systemctl status privoxy.service
● privoxy.service - Privoxy Web Proxy With Advanced Filtering Capabilities
Loaded: loaded (/usr/lib/systemd/system/privoxy.service; disabled; vendor preset: disabled)
Active: active (running) since Fri 2021-08-06 09:31:37 CST; 10s ago
Process: 2556 ExecStart=/usr/sbin/privoxy --pidfile /run/privoxy.pid --user privoxy /etc/privoxy/config (code=exited, status=0/SUCCESS)
Main PID: 2559 (privoxy)
Tasks: 1
CGroup: /system.slice/privoxy.service
└─2559 /usr/sbin/privoxy --pidfile /run/privoxy.pid --user privoxy...
Aug 06 09:31:36 MiWiFi-R1CM-srv systemd[1]: Starting Privoxy Web Proxy With ....
Aug 06 09:31:37 MiWiFi-R1CM-srv systemd[1]: Started Privoxy Web Proxy With A....
Hint: Some lines were ellipsized, use -l to show in full.
[root@MiWiFi-R1CM-srv ~]# chkconfig privoxy on
[root@MiWiFi-R1CM-srv ~]# vim /etc/profile
####profile#####
MY_PROXY_URL="http://127.0.0.1:8118/"
HTTP_PROXY=$MY_PROXY_URL
HTTPS_PROXY=$MY_PROXY_URL
FTP_PROXY=$MY_PROXY_URL
http_proxy=$MY_PROXY_URL
https_proxy=$MY_PROXY_URL
ftp_proxy=$MY_PROXY_URL
export HTTP_PROXY HTTPS_PROXY FTP_PROXY http_proxy https_proxy ftp_proxy
#########################
[root@MiWiFi-R1CM-srv ~]# source /etc/profile
[root@MiWiFi-R1CM-srv privoxy]# curl 10.96.4.187:19190
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Welcome to JBoss™</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel="StyleSheet" href="jboss.css" type="text/css"/>
</head>
<body>
<!-- header begin -->
```
privoxy代理服务器配置