yiisoft/proxy-middleware

`TrustedHostsNetworkResolver` - improve configuration

arogachev opened this issue · 1 comments

[
    'hosts' => [
        // ...
    ],
    RFC,
    X_PREFIX,
    // Custom
    [
        'ip' => 'y-forwarded-for',
        'port' => 'y-forwarded-port',
        // ...
    ],
    // ...
];

RFC works with "forwarded" header only. X_PREFIX is alias for:

[
    'ip' => 'y-forwarded-for',
    'port' => 'y-forwarded-port',
    // ...
],

The goal here is to separate these groups. Only one defined group is active based on IP header.