16

Has anybody tried using Paypal's IPN on a port other than 80?

I'm trying to specify a URL like http://domain.com:8080/url/to/ipn.php but the IPN request isn't getting through.

If I hit the URL directly from my browser it works fine.

Ian McIntyre Silber
  • 5,553
  • 13
  • 53
  • 76

2 Answers2

12

After doing multiple tests I was able to confirm that PayPal's Notification URL/notify_url can not contain a non-standard port number.

These urls will work:

http://my.website.com:80/ipnpage.aspx
https://my.website.com:443/ipnpage.aspx

These will not work:

http://my.website.com:81/ipnpage.aspx
https://my.website.com:82/ipnpage.aspx
Mark
  • 595
  • 5
  • 13
  • Submitted as a bug. Thanks for submitting your question. Use this reference number for follow up: #130124-000237 – Mark Jan 24 '13 at 19:59
  • Is this still a problem? I can't seem to get IPNs on non-standard ports. I find it so confusing why this restriction exists. – EdGruberman Jun 11 '13 at 17:55
  • @Ed: The restriction still exists. – Mark Jun 12 '13 at 20:21
  • @EdGruberman Annoying as it is, my guess is that PayPal don't want to make anymore holes in their outgoing firewall than are strictly needed. If they removed this restriction, unless they specified an alternate port themselves, they'd have to allow outgoing traffic on any port, which their security folks would, quite rightly, not be happy with. I can't be sure I'm right, since I have no affiliation with PayPal, but that's my best guess. – Peter Bagnall Feb 14 '14 at 10:02
  • 3
    2016 and this restriction still exists. – hectorg87 Aug 01 '16 at 15:54
5

If you have nginx server with possibility to access to it by ssh, then you can do:

Start ssh reverse proxy:

ssh -Nvv -o TCPKeepAlive=yes -R 3000:localhost:3000 username@your-server.com

Add nginx config to proxy a port 3000 on port 80:

server {
    listen       80;
    server_name  your-app.your-server.com;

    location / {
      proxy_pass          http://localhost:3000;
      proxy_set_header    Host             $host;
      proxy_set_header    X-Real-IP        $remote_addr;
      proxy_set_header    X-Forwarded-For  $proxy_add_x_forwarded_for;
      proxy_set_header    X-Client-Verify  SUCCESS;
      proxy_read_timeout 1800;
      proxy_connect_timeout 1800;
    }
}
Dmitry Polushkin
  • 3,283
  • 1
  • 38
  • 44