题
是否有人尝试过在80以外的其他端口上使用PayPal的IPN?
我正在尝试指定一个URL http://domain.com:8080/url/to/ipn.php 但是IPN请求无法通过。
如果我直接从浏览器点击URL,则可以正常工作。
解决方案
如果您有NGINX服务器可以通过SSH访问它,则可以执行:
启动SSH反向代理:
ssh -Nvv -o TCPKeepAlive=yes -R 3000:localhost:3000 username@your-server.com
添加nginx配置为代理端口80上的端口3000:
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;
}
}
其他提示
进行多次测试后,我能够确认PayPal的通知URL/NOTIFY_URL不能包含非标准端口号。
这些URL将起作用:
http://my.website.com:80/ipnpage.aspx
https://my.website.com:443/ipnpage.aspx
这些行不通:
http://my.website.com:81/ipnpage.aspx
https://my.website.com:82/ipnpage.aspx
不隶属于 StackOverflow