Proxy /api/event routes using withPlausibleProxy for custom domains
See original GitHub issueUsing withPlausibleProxy
the URL rewrite rules are applied. Additionally a custom domain can be set. However, I think it would also make sense to rewrite the POST /api/event
requests. As the script can be loaded but all plausible events are still being blocked.
<PlausibleProvider domain="http://plausible.example.com">
...
</PlausibleProvider>
const { withPlausibleProxy } = require('next-plausible')
module.exports = withPlausibleProxy({
customDomain: 'http://plausible.example.com',
})({
// ...your next js config, if any
})
This will proxy the GET request of fetching the script.js
but e.g. the event POST requests are going to http://plausible.example.com
and are still being blocked.
When self-hosting plausible it is currently only possible to host it on root path as no base path can be set, see discussion.
So I think it would be great if we could also proxy the event requests.
Issue Analytics
- State:
- Created 2 years ago
- Comments:16 (8 by maintainers)
Top Results From Across the Web
Proxying Plausible through Vercel with Next.js
There are two ways you can proxy Plausible through Next.js / Vercel. One is using the next-plausible npm package and the other is...
Read more >Set up a custom domain proxy for Analytics.js - Segment
Custom domains allow you to proxy Analytics.js and proxy all tracking event requests through your domain.
Read more >4lejandrito/next-plausible: Simple integration for https ... - GitHub
PlausibleProvider Props ; domain, The domain of the site you want to monitor. ; customDomain, Set this if you use a custom domain...
Read more >Using a Custom Domain And Certificate for your API Proxy in ...
In this video I show step by step how to configure an Apigee API Proxy to use a custom domain and certificate. First,...
Read more >Using next-plausible to proxy POST requests to Plausible ...
Hi all, I'm in the process of finishing off a Next.js site ... A GET request to the proxy URL returns Plausible's 404...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@4lejandrito I also receive the right script now and proxying works on my site, thanks for your time +1
Using the latest version of the docker image as of today I receive the right script, processing the data-api attribute correctly. Maybe you need to clear your docker cache to actually get the latest version?
@seeARMS, @thacoon