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

Krisna's avatar

How to enable Nginx Access Log on Laravel Homestead?

Hi Guys,

I'm using laravel/homestead (virtualbox, 3.1.0), and there is a way to enable the Nginx access log?

The access.log file did exist in the /var/log/nginx directory, but it empty and not logging anything.

0 likes
3 replies
ejdelmonico's avatar

Current homestead requires virtualbox 5.2 and vagrant 2.0.

ElwinB's avatar
ElwinB
Best Answer
Level 4

I believe the question was how to enable acces log.

This is quite easy; ssh into your homestead box (vagrant ssh) Then navigate to /etc/nginx/sites-available/

Here you should see a file with the name of the provisioned site you want to enable access logging for.

For example: test.com

You should do: sudo nano test.com (or use an editor you prefer).

Somewhere in the file you should see something like this:

access_log off;
error_log  /var/log/nginx/test.com-error.log error;

change this to:

access_log /var/log/nginx/test.com-access.log;
error_log  /var/log/nginx/test.com-error.log error;

Hit save (in nano: ctrl +x and Y and enter) Then, back in your terminal, type: sudo service nginx restart

Voila, all set, your access logging is now enabled for this domain!

3 likes
Krisna's avatar

hi @ElwinB

Thanks for the responses

Yes, I've figured it out exactly like your solution.

Please or to participate in this conversation.