Nginx/Passenger Meteor deployment - how to get real IP address

59 views
Skip to first unread message

ignl

unread,
Oct 15, 2016, 1:37:00 PM10/15/16
to Phusion Passenger Discussions
When deploying meteor app with simple nginx proxy I need to use this configuration to get real user ip address:
  location / {
    proxy_pass http://localhost:3000;
    proxy_set_header X-Real-IP $remote_addr;  # http://wiki.nginx.org/HttpProxyModule
    proxy_set_header Host $host;  # pass the host header - http://wiki.nginx.org/HttpProxyModule#proxy_pass
    proxy_http_version 1.1;  # recommended with keepalive connections - http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_http_version
    # WebSocket proxying - from http://nginx.org/en/docs/http/websocket.html
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection $connection_upgrade;

    add_header Cache-Control no-cache;
  }
I am interested in how to do the same with nginx/passenger meteor deployment because right now I don't see real IPs of my users.

Best regards,
ignl

Daniel Knoppel

unread,
Oct 16, 2016, 11:10:51 AM10/16/16
to Phusion Passenger Discussions
What setup are you using? The config is for a standalone Nginx, but how are you planning to use Passenger? Remove the standalone Nginx and use the Passenger integrated one? Or proxy to it with the Standalone/builtin mode? 


- Daniel

ignl

unread,
Oct 16, 2016, 2:41:55 PM10/16/16
to Phusion Passenger Discussions
Hi, thank you for a fast reply. I am already using nginx integration setup done exacly like in a meteor deployment guide and it is working fine except bcrypt issue (another thread) and this ip address issue. I found some properties in passenger docs but did not found full example as with standalone nginx meteor deployment, so not sure how to replicate that. As I understand I need to use passenger properties and not these of nginx?
Best regards,
ignl

Daniel Knoppel

unread,
Oct 17, 2016, 12:02:02 PM10/17/16
to Phusion Passenger Discussions
I still don't understand what mode you are using. Link to the guide you followed? There are several.

- Daniel

ignl

unread,
Oct 17, 2016, 1:05:01 PM10/17/16
to Phusion Passenger Discussions
Sorry I was not expressing myself clearly. I am using nginx integrated with passenger (NOT standalone passenger and NOT apache passenger).

Daniel Knoppel

unread,
Oct 17, 2016, 9:11:03 PM10/17/16
to Phusion Passenger Discussions
Reply all
Reply to author
Forward
0 new messages