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

[FEAT]: Support reverse proxy headers for forwarded #253

Open
daufinsyd opened this issue May 16, 2024 · 1 comment
Open

[FEAT]: Support reverse proxy headers for forwarded #253

daufinsyd opened this issue May 16, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@daufinsyd
Copy link

daufinsyd commented May 16, 2024

What happened?

Hi,

I set up cosmos behind a nginx proxy, configured to forward the real client IP

         set_real_ip_from        10.1.0.0/30;
         real_ip_header          proxy_protocol;
         proxy_set_header        Host            $host;
         proxy_set_header        X-Real-IP       $proxy_protocol_addr;
         proxy_set_header        X-Forwarded-For $proxy_protocol_addr;

However Cosmos only see the Nginx Proxy's IP, not the original client preventing the IP Whitelist to operate as desired on the URL.

I can't find help in the documentation, how should cosmos be configured to use headers client IP to match the Whitelist IP Rule.

Thanks !

What should have happened?

Cosmos Proxy should detect / use real client IP instead of the Nginx one.

How to reproduce the bug?

  1. Go to URL
  2. Create a new Proxy URL
  3. enter Whitelist IP in Advanced Security

Relevant log output

No response

Other details

The nginx reverse proxy itself is behind another proxy using the proxy_protocol to retrieve the source client IP.
Nginx sees the correct client IP. This part is working as expected.

System details

  • OS: GNU/Linux
  • Browser Firefox/Chrome
  • Version Cosmos 0.15.7
@daufinsyd daufinsyd added the bug Something isn't working label May 16, 2024
@azukaar
Copy link
Owner

azukaar commented May 20, 2024

This is not a bug Cosmos does not support forwarded IPs headers, renaming ticket into FEAT

@azukaar azukaar changed the title [BUG]: Cosmos behind a reverse proxy ignoring RealIP [FEAT]: Support reverse proxy headers for forwarded May 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants