Header IP

Bug Reports
  • Not a bug as I cannot recreate this on here, but on two of my nodebb instances the Recently logged IP parameter in the profile page is showing my localhost IP.

    Running ubuntu 14.04, nginx 1.6 and my nginx directives are setup correctly. Funnily enough my access log file (generated by nginx) is correctly showing the client IP so it's passing through in the header BUT node bb is not displaying it correctly.

    location / {
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header Host $http_host;
    proxy_set_header X-NginX-Proxy true;

    proxy_pass http://127.0.0.1:4568/;
    proxy_redirect off;

    Socket.IO Support

    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";
    }

    Which module is nodebb is reading the IP in the header? Will have a look.

  • I have noticed this too, it does also display different IP addresses but everyone has a 127.0.0.1 too.

  • @Scuzz said:

    I have noticed this too, it does also display different IP addresses but everyone has a 127.0.0.1 too.

    OK so it's not just me then. @julian want this logged in github? Can't recreate it on here but seems at least another member is seeing this.

  • Is your use_port set to false? If so, NodeBB will trust referrer IP as passed in via nginx. Otherwise, it will assume 127.0.0.1, as that is really where the requests are coming from 🙂

  • @julian said:

    Is your use_port set to false? If so, NodeBB will trust referrer IP as passed in via nginx. Otherwise, it will assume 127.0.0.1, as that is really where the requests are coming from 🙂

    Being thick here, but where's that set?

  • @nik Your config.json file 🙂 (If this is the source of the problem, then perhaps this is a candidate for inclusion into the NodeBB FAQ...)

  • @julian said:

    @nik Your config.json file 🙂 (If this is the source of the problem, then perhaps this is a candidate for inclusion into the NodeBB FAQ...)

    use port set to true

  • @nik Yes, that looks to be the problem then, set it to false and give it a whirl. (If you're using nginx, use_port should be false, in 99.99% of cases)

  • @julian said:

    @nik Yes, that looks to be the problem then, set it to false and give it a whirl. (If you're using nginx, use_port should be false, in 99.99% of cases)

    That did the trick. Thanks sir. Maybe update the doc in case it wasn't mentioned plainly enough.

  • Make your life easier, created issue #1744 on github for the FAQ update.


Suggested Topics