Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

mikromike's avatar

Filamentphp +https url /storage access denided

Hello

After swiched from http to https url /storage/ (403) Forbidden.

ran php artisan optimize:clear and added folder storage and subfolder sudo chmod 777 storage/ -R and sudo chown www-data:www-data storage/ -R also recreated storage link.

config/filesystems

 'disks' => [
	    'local' => [
        'driver' => 'local',
        'root' => storage_path('app'),
        'throw' => false,
    ],

    'public' => [
        'driver' => 'local',
        'root' => storage_path('app/public'),
        'url' => env('APP_URL').'/storage',
  1. is there something in filament side which am missing?
  2. also login page css is broken. It was working before swich.

.env APP_ENV=production APP_URL="https://domain.com" APP_DEBUG=false ASSET_URL=/public <-- did not help anyway!

Thanks Mika.

0 likes
2 replies
LaryAI's avatar
Level 58

It seems like you're facing a couple of issues after switching from HTTP to HTTPS. Let's address them one by one:

  1. Access Denied to /storage URL: The issue might not be directly related to FilamentPHP but rather to your web server configuration or Laravel's filesystem configuration. Since you've already set the correct permissions and ownership, and recreated the storage link, let's ensure that your web server is correctly configured to serve the /storage directory.

For Apache, make sure you have an .htaccess file with the following content in your public directory:

<IfModule mod_rewrite.c>
    RewriteEngine On

    # Handle Front Controller...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L]

    # Handle Authorization Header
    RewriteCond %{HTTP:Authorization} .
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
</IfModule>

# Handle Storage Directory
<Directory "/path/to/your/project/public/storage">
    Options Indexes FollowSymLinks
    AllowOverride All
    Require all granted
</Directory>

Replace /path/to/your/project with the actual path to your Laravel project.

For Nginx, you should have a configuration block in your site's configuration file that allows access to the storage directory:

location /storage {
    alias /path/to/your/project/public/storage;
    try_files $uri $uri/ /index.php?$query_string;
}

Again, replace /path/to/your/project with the actual path to your Laravel project.

  1. Broken CSS on the login page: This could be due to the ASSET_URL not being set correctly. Since you're now using HTTPS, you need to ensure that all assets are loaded over HTTPS to avoid mixed content issues.

In your .env file, you should set the ASSET_URL to the full URL of your application:

ASSET_URL=https://domain.com/public

After making these changes, clear the configuration cache:

php artisan config:clear

And then, regenerate the symbolic link to the storage directory:

php artisan storage:link

Make sure that your web server has restarted after making these changes to ensure that the new configuration is applied.

If you continue to experience issues, check the web server error logs for more specific error messages that can help you troubleshoot the problem.

mikromike's avatar
					# Handle Storage Directory
					<Directory "/path/to/your/project/public/storage">
					    Options Indexes FollowSymLinks
						AllowOverride All
					 Require all granted
			    </Directory>

After added provious code to Apache2 sites config. Main page could not find livewire.min.js.

Notited that it looking file from /public/js/filament/filament/app.js have add extra public folder to make it work.

So there is still something wrong in Filamentphp , how it try find js & css files after changed to https. temporary fix works now.

Please or to participate in this conversation.