Replies: 1 comment
-
Identifying the issue with a font not loading on your website in the Laravel Forge production environment can be a challenging task. To troubleshoot this problem, you need to follow several steps: 1. Check Nginx Configuration in Laravel Forge: Ensure that the Nginx configuration on your Laravel Forge server is correct. Check if the font file location configuration points to the correct directory. 2. Check Storage Linking: Make sure that the symbolic link to the storage directory has been set up correctly in your Nginx configuration. Typically, you'd use the php artisan storage:link command to create this link. 3. Check Permissions: Ensure that permissions on the font files and the directory containing the fonts are set correctly so that the web server can access them. Confirm that the URLs used to fetch the font in your code are correct. Your code should reference the correct URL for the font based on the configured symbolic link. 4. Clear Cache: Sometimes, issues like this can be caused by caching on the server or in your browser. Be sure to clear the cache on both sides. 5. Check Nginx Error Logs: Check the Nginx error logs on your Forge server. These logs will provide further information about any issues encountered when trying to retrieve the font. 6. Test with Another Font: Try including another font that is known to work well. This will help you understand if the problem is specific to a particular font or if there is a more general issue. 7. Check Firewall: Ensure that your server's firewall is not blocking access to the font. Some firewalls may block specific font requests if they are deemed suspicious. 8. Verify Internet Connection: Make sure your server has a functioning internet connection. A poor connection can result in fonts not loading. 9. Check Laravel Forge Modifications: If you have made specific modifications on your Laravel Forge server that differ from your development environment, ensure that these modifications are not affecting font retrieval. 10. Contact Laravel Forge Support: If you cannot find a solution after trying the above steps, consider reaching out to Laravel Forge support. They can provide further guidance or help identify the issue. 11. Test with a Similar Local Server: Create a local server environment similar to your production server configuration and attempt to reproduce the issue locally. This can help isolate the problem and find a solution without affecting the production server. Follow this link https://stackoverflow.com/questions/54139376/load-balancer-with-laravel-forge-got-404-css |
Beta Was this translation helpful? Give feedback.
-
No not loading from google, but loading into the webpage.
The Font gets installed in the storage folder correctly, I can see it on the server in the correct location:
storage/app/public/fonts/662af10b79/srighteousv171cxxaupxbpj2rgou7c9wihgfq8kk1q.woff2
and
storage/app/public/fonts/662af10b79/srighteousv171cxxaupxbpj2rgou7c9whngfq8kk1doh.woff2
The owner is set right, the permissions are fine. The storage link in the public folder points to the correct folder.
To test this, putting an image in the same folder as the font, I can see the image in my browser under the expected url.
But the browser cannot load the font. Do I try to open the font with the browser I get a 404 error.
I am going nuts on that problem, I do not believe that laravel-google-fonts did anything wrong, but I guess that laravel forge nginx configuration might mess up something. Did anyone have the same problem and has an idea of how to handle this?
I should also add that in my development environment (with docker) everything works, the font loads. But on the forge managed server it does not. So it must be something odd with the forge managed server.
Beta Was this translation helpful? Give feedback.
All reactions