Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LogViewer::auth not working behind proxy #396

Closed
btxtiger opened this issue Oct 2, 2024 · 3 comments
Closed

LogViewer::auth not working behind proxy #396

btxtiger opened this issue Oct 2, 2024 · 3 comments

Comments

@btxtiger
Copy link

btxtiger commented Oct 2, 2024

Not sure why it is the case, but when Laravel runs with Octane as reverse proxy (in production),

\LogViewer::auth(fn () => auth()->check());

does not work and always leads to a 403 error, while

\Gate::define("viewLogViewer", fn () => auth()->check());

works fine.

PHP-FPM did not have this issue. I tested if it is a remote_addr related thing, by mapping it to the real IP instead of the Docker IP (real_ip_header X-Forwarded-For;), but it didn't help.

@A-Moussa0
Copy link

I faced the same issue, but even with Gate, I am able to access the viewer but not see the list of log files

@A-Moussa0
Copy link

A-Moussa0 commented Oct 25, 2024

I faced the same issue, but even with Gate, I am able to access the viewer but not see the list of log files

Here is actually the problem I am describing, it seems to have already been fixed. I will the proposed solution a try
#366

@arukompas
Copy link
Contributor

arukompas commented Oct 26, 2024

This might be due to configuration of the proxy. You must forward authorisation and host headers, otherwise Laravel might deny the request.

Dump your request headers in any controller, and make sure you still receive the "Authorization" header, as well as the Host is set to the same as your "APP_URL" variable, or at least the host is added to the "LOG_VIEWER_API_STATEFUL_DOMAINS" variable

https://log-viewer.opcodes.io/docs/3.x/configuration/route-and-domain#production-domains

@arukompas arukompas closed this as not planned Won't fix, can't repro, duplicate, stale Feb 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants