SteveLTN / https-portal

A fully automated HTTPS server powered by Nginx, Let's Encrypt and Docker.
MIT License
4.46k stars 295 forks source link

Wrong ip in log #283

Closed P6g9YHK6 closed 3 years ago

P6g9YHK6 commented 3 years ago

i am getting a repeat of this in my log:"192.168.1.1 - - [16/Jun/2021:16:39:18 +0000] "POST /api/auth HTTP/1.1" 400 67 "-" "GuzzleHttp/6.3.3 curl/7.77.0 PHP/7.3.27" "-""

but the ip is the one of my gateway not the source is there a way to have the real ip ?

SteveLTN commented 3 years ago

The gateway's IP is the incoming request is sent from the gateway. Obviously we can't change that.

However, HTTPS-PORTAL will add a header X-Real-IP to incoming requests, which is a standard way to tell the upstream what the client's IP is. You probably just need to configure your application so that it respects this header.

P6g9YHK6 commented 3 years ago

The issue is with this one in particular i am getting the correct ip for any other log.

it's a botnet trying to bruteforce one of my service and i am trying to find a way to block it.

SteveLTN commented 3 years ago

Can't you check the log of your gateway then? You can also try to use custom Nginx config, according to this post.