403 error when verifying Apple Pay

Hi,
I’m using Wordpress 5.3.x and installed WooCommerce with Stripe integration. One of the things to get Apple Pay support is domain verification. WooCommerce automatically put a file on your server which then would need to be verified on Stripe.com to check that you are indeed the owner. However, when I do the check, I get a 403 error. I see the file on the server https://domain.com/.well-known/apple-developer-merchantid-domain-association and it does have correct permissions. Any help would be great.

Here is the exact message from Stripe

We attempted to retrieve the file at https://domain.com/.well-known/apple-developer-merchantid-domain-association, but received a 403 status code from your server. Please check that the file is hosted correctly. Note that our servers most likely send different HTTP headers than your browser; you should check your logs to see why the request failed. For more information, see https://stripe.com/docs/stripe-js/elements/payment-request-button#verifying-your-domain-with-apple-pay.

Ok. I finally figured it out. For anyone with this same issue, here’s what I did.

  1. Make sure you have the apple-developer-merchantid-domain-association file in your .well-known directory
  2. Open your user.conf file located at /opt/easyengine/sites/domain.com/config/nginx/custom/user.conf
  3. Enter in
location ^~ /.well-known/apple-developer-merchantid-domain-association {
		auth_basic off;
		allow all;
		try_files $uri =404;
		break;
	}
  1. Save the file and restart ngnix