Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RemoteIP module not working with AWS NLB Proxy Protocol v2 #269

Open
staffdill opened this issue Nov 12, 2024 · 0 comments
Open

RemoteIP module not working with AWS NLB Proxy Protocol v2 #269

staffdill opened this issue Nov 12, 2024 · 0 comments

Comments

@staffdill
Copy link

Hello, trying to label this as a question,
we are trying to implement this behind an AWS nlb with proxy protocol v2 turned on, if turned off everything works properly. Turning it on causes errors.
Am I missing something?

Would appreciate any help I'm newer to apache.

in my config I have
LoadModule headers_module modules/mod_headers.so
LoadModule remoteip_module modules/mod_remoteip.so

root@8b41f20ef6ed:/usr/local/apache2/logs# apachectl -M | grep remote
 remoteip_module (shared)
root@8b41f20ef6ed:/usr/local/apache2/logs# apachectl -M | grep header
 headers_module (shared)

in my virtual host I am simply trying to configure a health check on port 80 at /200/ok. This works turning proxy protocol v2 off.

<VirtualHost *:80>

        ServerName localhost
        RemoteIPProxyProtocol On
        RemoteIPHeader X-Forwarded-For
        #RemoteIPProxyProtocolExceptions *load-balancer-ips*

        Alias /200/ok /usr/local/apache2/htdocs/ok.json
        <Location "/200/ok">
                SetHandler none
                Header set Content-Type "application/json"
        </Location>

	CustomLog "/usr/local/apache2/logs/access-log-80.log" combined 
        ErrorLog "/usr/local/apache2/logs/error-log-80.log"
</VirtualHost>

turning it on however gives me errors.

[Tue Nov 12 04:11:30.530815 2024] [remoteip:error] [pid 437:tid 437] [client 10.104.101.122:22405] AH03507: RemoteIPProxyProtocol: unsupported command 20
[Tue Nov 12 04:11:30.752601 2024] [remoteip:debug] [pid 438:tid 438] mod_remoteip.c(922): [client 10.104.103.177:62866] AH03503: RemoteIPProxyProtocol: enabled on connection to 172.18.0.3:80
[Tue Nov 12 04:11:30.752685 2024] [remoteip:error] [pid 438:tid 438] [client 10.104.103.177:62866] AH03507: RemoteIPProxyProtocol: unsupported command 20
[Tue Nov 12 04:11:31.056082 2024] [remoteip:debug] [pid 439:tid 439] mod_remoteip.c(922): [client 10.104.103.177:32919] AH03503: RemoteIPProxyProtocol: enabled on connection to 172.18.0.3:80
@staffdill staffdill changed the title AWS NLB Proxy Protocol v2 not working RemoteIP module not working with AWS NLB Proxy Protocol v2 Nov 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant