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

How to log real ip when behind reverse proxy? #348

Open
void4 opened this issue Jun 15, 2020 · 1 comment
Open

How to log real ip when behind reverse proxy? #348

void4 opened this issue Jun 15, 2020 · 1 comment

Comments

@void4
Copy link

void4 commented Jun 15, 2020

I'm using nginx to multiplex between multiple flask/uwsgi servers. However, flask_monitoringdashboard only logs the IP of the request, which is 127.0.0.1

The following is my nginx.conf:

server {
        listen 443 ssl;
        server_name randomeps.com www.randomeps.com;
        ssl_certificate /etc/letsencrypt/live/randomeps.com/cert.pem;
        ssl_certificate_key /etc/letsencrypt/live/randomeps.com/privkey.pem;

        location / {
                proxy_pass http://0.0.0.0:9000;
                proxy_set_header Host $host;
                proxy_set_header X-Forwarded-Proto $scheme;
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

                include /etc/nginx/mime.types;
        }
}


@ameydeshpande30
Copy link

#390 I have created PR for this.

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

2 participants