Closed alexandre-dos-reis closed 12 months ago
Hi @alexandre-dos-reis! Sorry for the late response.
Let me know your findings.
I also ran into this issue, where it seems the nextjs rewrites does not pass the correct X-Forwarded-For header during the proxying. I'm in the position that I have a workaround that proxies the plausible event traffic before it reaches the nextjs app.
I couldn't spend too much time investigating, but I did find this discussion with an open pull request mentioned from September 2022 that would allow custom headers, but I think @4lejandrito might be correct that as of NextJS v13, using middleware to add request headers is the best route. If I ever get around to trying it, I'll report back!
I am closing this as there is little we can do on the library side.
Hi @4lejandrito and thank you for your excellent work !
I tested the 2 methods described in the docs.
1° This config is working properly, I get all the data in my plausible dashboard.
_app.tsx
2° This method is working partially, I'm missing the countries data in my plausible dashboard.
_app.tsx
next.config.js
I think this is caused by the second option not properly passing the header
x-forwarded-for
.By the way, is the second config correct ?
Thank you.