Laravel 500 error on VPS

I uploaded my laravel app to ubuntu VPS. I was noticing 500 error frequently. My app was in /default directory on Nginx server and my domain was pointed to /default/public directory.

Finally I could get rid of this problem running the following commands:

sudo chmod 755 -R default
chmod -R o+w default/storage

I was getting error for cache. Then I ran the following command:

php artisan cache:clear