[squid-users] variable/macro, setting outgoing address
Matus UHLAR - fantomas
uhlar at fantomas.sk
Thu Nov 26 11:28:52 UTC 2026
>On 25 November 2026 2:39:21 pm UTC, Matus UHLAR - fantomas <uhlar at fantomas.sk> wrote:
>> Is it possible to have kind of variable/macro that would be defined in
>> included (conf.d) file, to be used in config_file instead of local IP
>> address?
On 25.11.26 16:13, Nishant Sharma wrote:
>Would it work if you keep all the config same on all squids except one that you include from a conf.d directory - that config just has:
>
> tcp_outgoing_address x.x.x.x special_hosts
> acl special_hosts src "/path/to/hosts_file"
>
> in main config which is common across the squids and you just have to
> manage the value of x.x.x.x on each squid server (can be scripted / squid
> init script be modified to populate x.x.x.x on start-up)
This seems to be possible, although confusing in case of multiple ACLs to
match.
ssl_bump is something I'd like to avoid...
On 27.11.26 00:05, Amos Jeffries wrote:
>You can also assign the x.x.x.x to a unique hostname in /etc/hosts (or
>DNS), and configure:
>
> tcp_outgoing_address hostname special_hosts
>
>Squid will resolve the hostname to find x.x.x.x on each startup and
>reconfigure action.
>
>If you do this way, be careful that the hostname only resolves to a
>single IP, and that IP is assigned to one of the network interfaces of
>the machine.
Unfortunately this soluton is not available, since /etc/hosts has to be
configured across those proxies as well, doesn't support includes
and squid seems not to support multiple hosts files as well.
I think asking developers for multiple hosts support does not make sense
outside of this issue.
--
Matus UHLAR - fantomas, uhlar at fantomas.sk ; http://www.fantomas.sk/
Warning: I wish NOT to receive e-mail advertising to this address.
Varovanie: na tuto adresu chcem NEDOSTAVAT akukolvek reklamnu postu.
Micro$oft random number generator: 0, 0, 0, 4.33e+67, 0, 0, 0...
More information about the squid-users
mailing list