title: Status 500 Internal Server Error between droplet with nginx and google cloud storage
body: <p>I have a web system in a droplet with Digital Ocean, the droplet has installed nginx, the system has an option to upload files, these files are sent to a Google Cloud Storage bucket. When I am in the localhost the files are sent correctly, but already in the system, I am receiving a Status 500 Internal Server Error.
  I leave some screenshots</p>
  
  <p><a href="https://i.stack.imgur.com/Pv3N4.png" rel="nofollow noreferrer">Image of the System and Error</a></p>
  
  <p>Also getting the <strong>response</strong>:</p>
  
  <p>{
      "message": "Server Error"
  }</p>
  
  <p>But when I run it from localhost</p>
  
  <p><a href="https://i.stack.imgur.com/9WrN2.png" rel="nofollow noreferrer">All good in localhost</a></p>
  
  <p>This is my GoogleStorageServiceProvider</p>
  
  <pre><code>public function boot()
  {
      \Storage::extend('gcs', function($app, $config){
  
          $storageClient = new StorageClient([
              'projectId' =&gt; $config['project_id'],
              'keyFilePath' =&gt; $config['key_file'],
          ]);
          $bucket = $storageClient-&gt;bucket($config['bucket']);
  
          $adapter = new GoogleStorageAdapter($storageClient, $bucket);
  
          return new Filesystem($adapter);
      });
  }
  </code></pre>
  
  <p>This is my .env</p>
  
  <pre><code>APP_NAME=Laravel
  APP_ENV=production
  APP_KEY=MY_KEY
  APP_DEBUG=false
  APP_URL=http://.com
  
  LOG_CHANNEL=stack
  
  DB_CONNECTION=mysql
  DB_HOST=127.0.0.1
  DB_PORT=3306
  DB_DATABASE=database
  DB_USERNAME=root
  DB_PASSWORD=databasepass
  
  GOOGLE_CLOUD_PROJECT_ID=starlit...
  GOOGLE_CLOUD_KEY_FILE=/my-project/credentials.json
  GOOGLE_CLOUD_STORAGE_BUCKET=my-bucket
  FYLESYSTEM_DRIVER=gcs
  
  BROADCAST_DRIVER=log
  CACHE_DRIVER=file
  QUEUE_CONNECTION=sync
  SESSION_DRIVER=file
  SESSION_LIFETIME=120
  </code></pre>
  
  <p>This is my sudo vim /etc/nginx/sites-available/YOUR.DOMAIN.COM file</p>
  
  <pre><code>server {
  listen 80;
  listen [::]:80;
  
  server_name YOUR.DOMAIN.COM;
  return 301 https://$server_name$request_uri;
  }
  
  server {
  listen 443 ssl http2;
  listen [::]:443 ssl http2;
  server_name YOUR.DOMAIN.COM;
  root /var/www/html/first-project/public;
  
  ssl_certificate /etc/letsencrypt/live/YOUR.DOMAIN.COM/fullchain.pem;
  ssl_certificate_key /etc/letsencrypt/live/YOUR.DOMAIN.COM/privkey.pem;
  
  ssl_protocols TLSv1.2;
  ssl_ciphers ECDHE-RSA-AES256-GCM-SHA512:DHE-RSA-AES256-GCM-   SHA512:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-SHA384;
  ssl_prefer_server_ciphers on;
  
  add_header X-Frame-Options "SAMEORIGIN";
  add_header X-XSS-Protection "1; mode=block";
  add_header X-Content-Type-Options "nosniff";
  
  index index.php index.html index.htm index.nginx-debian.html;
  
  charset utf-8;
  
  location / {
          try_files $uri $uri/ /index.php?$query_string;
  }
  
  location ~ \.php$ {
      include snippets/fastcgi-php.conf;
      fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
  }
  
  location ~ /\.ht {
          deny all;
  }
  
  location ~ /.well-known {
          allow all;
  }
  }
  </code></pre>
  
  <p>Any idea what's happening? </p>