bob*_*lin 5 google squid http-headers application
我想允许我的用户仅为我的域登录 Google 应用程序。我通过添加此 Google 帮助页面中X-GoogApps-Allowed-Domains
所述的 HTTP 标头找到了解决方案。
我使用 Squid,但不知道如何配置 Squid 来执行此操作。如何使用 Squid 添加此请求标头?
小智 7
您可以使用支持命令“request_header_add”的新 Squid 3.3。我使用 CentOS 来做这件事。
我的 Squid.conf 是:
acl CONNECT method CONNECT
visible_hostname MySERVER.local
acl local src 192.168.0.0/24
http_access allow local
ssl_bump client-first all
always_direct allow all
http_port 3128 ssl_bump generate-host-certificates=on dynamic_cert_mem_cache_size=4MB cert=/usr/local/squid/etc/cert.pem
request_header_add X-GoogApps-Allowed-Domains "mycompany.com" all
cache_dir ufs /usr/local/squid/var/cache 8192 32 256
Run Code Online (Sandbox Code Playgroud)
对于SSL证书,是否需要用openSSL生成:
openssl req -new -newkey rsa:1024 -days 36500 -nodes -x509 -keyout /usr/local/squid/etc/cert.pem -out /usr/local/squid/etc/cert.pem
Run Code Online (Sandbox Code Playgroud)
对于用户无法在浏览器中查看错误的情况,请将其安装为每台计算机中受信任的 root 或添加到您的 Active Directory 中(谷歌可能会对此有所帮助)。
openssl x509 -in /usr/local/squid/etc/cert.pem -outform DER -out /usr/local/squid/etc/cert.der
Run Code Online (Sandbox Code Playgroud)