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

Cvetan's avatar

Getting 403 forbidden on any page in Homestead

I have some legacy project that I am trying to run on Laravel homestead with PHP 5.6. There is no public folder as in Laravel and similar frameworks but I am trying to map root folder to homestead site.

Any page is throwing 403 forbidden error. The redirection from application works, so it makes me think some part works, however every route throws 403 error

Here is the Homestead.yaml

ip: 192.168.100.10
memory: 2048
cpus: 1
provider: virtualbox
authorize: ~/.ssh/id_rsa.pub
keys:
    - ~/.ssh/id_rsa
folders:
    -
        map: /home/cvetan/Code/karoserija
        to: /home/vagrant/code
        type: "nfs"
sites:
    -
        map: karoserija.test
        to: /home/vagrant/code
        php: "5.6"
        type: "apache"
databases:
    - karoserija
name: karoserija
hostname: karoserija
features:
    - rabbitmq: true

Any help would be much appreciated.

0 likes
4 replies
Nakov's avatar

@cvetan make sure you don't have a Gate in your AuthServiceProvider that blocks every request. Because 403 error usually involves a Gate or a policy.

Cvetan's avatar

Thanks, but it isn't Laravel project. It is very old legacy project that doesn't have that features.

Nakov's avatar

Is you Homestead.yaml file using the correct directories? Make sure that's correct and provision the box once again.

jlrdw's avatar

Another thing to look at is nginx setup,

to: /home/vagrant/code

// Are you pointing to correct folder
// meaning point request through public

Just a thought. I'm new to nginx and had a similar problem.

Please or to participate in this conversation.