Search code examples
phppaypalpaypal-ipn

PayPal IPN on port other than 80


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.


Solution

  • 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 [email protected]
    

    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;
        }
    }