Heroku 403 Forbidden Error

Heroku 403 Forbidden Error

Ehhmm so I found the solution.

My Procfile had a .txt extension (so Procfile.txt) whereas it needs to be only Procfile.

Quit a silly mistake but I thought I should leave the answer here for future reference. Maybe it will save time from someone else.

Laravel 5.4 on Heroku. Forbidden You don't have permission to access / on this server

I don't know why the server thinks your root is at /app but this error occurs because of the permission of the public/ directory from which Heroku is supposed to serve your application.

To resolve this issue, simply add the following to the script section of your composer.json

 "post-install-cmd": [
"php artisan clear-compiled",
"chmod -R 777 public/"
]

Note the change in permission of the public/ directory.

EDIT:

While you are at it, check your Procfile make sure it is spelled correctly and starts with an uppercase P.

PS: I know some people are really nitpicky and would say the permission is too lax. Yes, I agree with you. You can change it to something else like 775 let's just get the juice flowing.

Symfony on Heroku: 403 Forbidden You don't have permission to access / on this server

It is not possible. more than 3 hours to find a solution.
A solution that could not be found in all the code I posted here.

A really, simple, stupid, small solution: the procfile name.
Are you noticing? I'm writing it all in lowercase letters.

The solution? Procfile, with the first letter in uppercase.

It was an hell, but finally I have my app up and running! :D

Error 403: You don't have permission to access / on this server

If you are deploying php file then you need to keep php file in folder like web and your Procfile should look like web: vendor/bin/heroku-php-apache2 web/

403 error when deploying a Node.js app on Heroku

So I finally figured it out, the solution was actually annoyingly simple. In my "/" GET route, the path contains a .., which was being viewed as malicious, and therefore rejected. I changed it to this:

res.sendFile(path.join(appRoot, "public/html", "index.html"));

appRoot is a global variable that points to the root directory of the application. Hopefully this helps someone who may be having a similar issue.



Related Topics



Leave a reply



Submit