-
Is there a way to use Log Viewer when my EC2 is behind a Load Balancer? My Auto Scaling has just 1 EC2. I'm getting 2 prompts, with only an "ok" button, first this: app.js failed to load. Please refresh the page, re-publish Log Viewer assets, or fix routing for vendor assets. then this: app.css failed to load. Please refresh the page, re-publish Log Viewer assets, or fix routing for vendor assets. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
@gssj85 I'm not too familiar with AWS Load Balancer, but it seems like the static assets are not accessible.
|
Beta Was this translation helpful? Give feedback.
-
API was generating HTTP links instead of HTTPS for the assets which triggered the error, I'm not too much sure about the flow of the requests but I believe some forward header was not being readed because the application didn't consider it safe so it used it's "internal" http address to generate the assets instead of https. This is not a Log Viewer issue but the way our infrastructure was setup at AWS. Leaving solution if anyone else need. The solution was allowing all proxies in the TrustProxies middleware: /**
* The trusted proxies for this application.
*
* @var string|array
*/
protected $proxies = '*'; https://laravel.com/docs/9.x/requests#configuring-trusted-proxies Whoever is thinking of using this solution be aware that your EC2 should only accept requests from the Load Balancer for this approach to be safe. |
Beta Was this translation helpful? Give feedback.
API was generating HTTP links instead of HTTPS for the assets which triggered the error, I'm not too much sure about the flow of the requests but I believe some forward header was not being readed because the application didn't consider it safe so it used it's "internal" http address to generate the assets instead of https.
This is not a Log Viewer issue but the way our infrastructure was setup at AWS. Leaving solution if anyone else need.
The solution was allowing all proxies in the TrustProxies middleware:
https://laravel.com/docs/9.x/requests#configuring-trusted-proxies
Whoever is thi…