#JoelBermudez

1 messages · Page 1 of 1 (latest)

trail viperBOT
swift meteor
#

Hi! Let me help you with this.

#

It depends how is your server hosted

sudden fern
#

It's self-hosted, so yeah, no proxies

#

I'm gonna continue with the tests then, thanks!

#

I guess I need to open 4242 port TCP right?

#

Or UDP too?

swift meteor
#

If it's a public server, it's better hosted on port 443, but you will need to set up HTTPS for this.

sudden fern
#

I have already 80 and 443 open. But if the endpoint is :4242 I should open 4242 too right?

#

443 would be for serving HTML

swift meteor
#

Everything should be served through the same port. I don't think Stripe allows calling non-HTTPS webhook endpoints.

sudden fern
#

So, if I set up the webhook like with app.post /webhook and app.listen 4242

How can I make an nginx parameter to serve that via the HTTPS on 443?

swift meteor
#

Yes

sudden fern
#

https://stripe.com/docs/webhooks/go-live

I'm looking at this...

For example, if your domain is https://mycompanysite.com and your webhook endpoint route is @app.route('/stripe_webhooks', methods=['POST']), specify https://mycompanysite .com/stripe_webhooks as the endpoint URL.

But how can I implement the endpoint route via NodeJS / Nginx?

trail viperBOT
swift meteor
#

You can direct the traffic coming to /webhook to be forwarded to your :4242 server.

#

In you nginx config

#

The config would looks something like this:

server {  
    listen 80;  
    server_name example.com;  
  
    location /webhook {  
        proxy_pass http://localhost:4242;  
        proxy_set_header Host $host;  
        proxy_set_header X-Real-IP $remote_addr;  
    }  
}