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

[BUG] Wrong IPs reported? #69

Closed
rubenmdh opened this issue Oct 22, 2019 · 2 comments
Closed

[BUG] Wrong IPs reported? #69

rubenmdh opened this issue Oct 22, 2019 · 2 comments
Labels
not a bug Not a bug

Comments

@rubenmdh
Copy link

Hello,
it seems that lolisafe doesn't report the correct IPs on the "Manage uploads" tab from the admin interface. All the uploads have the same IP: ::ffff:127.0.0.1

I am not sure if this has something to do with nginx not passing the correct IP to the lolisafe daemon or if it is an error of lolisafe itself.

I am using the nginx config sample provided by lolisafe and nginx logs show the real visitor's address. Here is a sample of the access.log of nginx.

37.14.X.X - - [22/Oct/2019:13:15:51 +0200] "GET /js/dashboard.js HTTP/2.0" 304 0 "https://[REDACTED]/dashboard" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:69.0) Gecko/20100101 Firefox/69.0"
37.14.X.X - - [22/Oct/2019:13:15:51 +0200] "GET /images/logo.png HTTP/2.0" 304 0 "https://[REDACTED]/dashboard" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:69.0) Gecko/20100101 Firefox/69.0"
37.14.X.X - - [22/Oct/2019:13:15:51 +0200] "GET /js/misc/utils.js HTTP/2.0" 304 0 "https://[REDACTED]/dashboard" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:69.0) Gecko/20100101 Firefox/69.0"
37.14.X.X - - [22/Oct/2019:13:15:52 +0200] "POST /api/tokens/verify HTTP/2.0" 200 110 "https://[REDACTED]/dashboard" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:69.0) Gecko/20100101 Firefox/69.0"
37.14.X.X - - [22/Oct/2019:13:15:52 +0200] "GET /api/albums/sidebar HTTP/2.0" 304 0 "https://[REDACTED]/dashboard" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:69.0) Gecko/20100101 Firefox/69.0"
37.14.X.X - - [22/Oct/2019:13:15:55 +0200] "GET /api/uploads/0 HTTP/2.0" 200 1070 "https://[REDACTED]/dashboard" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:69.0) Gecko/20100101 Firefox/69.0"

Any help is appreciated.

@BobbyWibowo
Copy link
Owner

If you use nginx (or any http servers for that matter), you're actually using it as a reverse proxy for the node server. Which means you need to set trustProxy in config.js to true as well.
You only set trustProxy to false when the node server itself communicates directly with clients (no local http server acting as reverse proxies, no CDNs like Cloudflare, etc).
I'll update the comments in the sample config file at a later date, cause it seems I only mentioned CDNs.

@rubenmdh
Copy link
Author

Oh, my bad. Setting trustProxy to true did the trick.

Thanks! Closing this now.

@BobbyWibowo BobbyWibowo added the not a bug Not a bug label May 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
not a bug Not a bug
Projects
None yet
Development

No branches or pull requests

2 participants