Reverse Proxy Setup with Cloudflare
These are the steps for setting up reverse proxy for your SEO menu using Cloudflare.
Your site may go down temporarily when nameservers are changed over.
Step 1: In the AIQ Ecomm backend under Store -> Settings -> SEO, fill out the menu URL with the URL you plan on using for your SEO menu. Save the change.
Step 2: Set up a Free Cloudflare account and pull in your domain and DNS records. If you already have a Cloudflare account then login and skip to step 4 or 5 depending if you are already using Cloudflare namesevers. You should have Cloudflare and your domain hosting provider open in two tabs. In both platforms navigate to your DNS records.
Step 3: In Cloudflare your A record(s) and the CNAME for www should be proxied, the rest can be DNS only:
On that DNS records page, scroll down to the bottom of the page until you see 'Cloudflare Nameservers':
Step 4: In your domain hosting provider navigate to your nameservers. Choose 'custom nameservers' and paste in the two nameservers provided by Cloudflare (they will be different than the ones in the screenshot).
Step 5: Go back to Cloudflare -> Workers & Pages -> Create Worker. Update the title and deploy the 'Hello World' worker. The worker needs to be deployed first to be edited.
Step 6: That should bring you to a page like this, click the 'Edit Code' button in the top right corner.
You can also click into the worker from the overview page to see the 'Edit Code option:
Step 7: You will delete the existing code for the worker and paste in the worker code from the AIQ Ecomm backend under Store -> Developers -> SEO -> Cloudflare.
And then click the 'deploy' button in the top right corner:
Click the back button to return to this main page for the worker and go to 'Settings':
Step 8: Once you are in Settings -> Domain & Routes you will add the route *mywebsite.com/menu* or /shop, whatever you are using for your url. Cloudflare may promt you to have a period in the front of the route like this *.mywebsite.com/menu* but you do not need that.
Step 9: In Cloudflare, go to SSL/TLS -> Configure:
Select Fulll(strict) and save your changes:
And that's it!
It can take up to a few hours for the nameservers to switch over from your domain hosting provider to Cloudflare, though sometimes it is much faster. Your site will usually go down when the nameservers are switching over. You can watch them switch over here:
If you need to revert your changes simply switch the name servers in your domain hosting provider back to the original ones instead of the Cloudflare nameservers.