Skip to content
Grav 2.0 is officially stable. Read the announcement →

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

Installation & Hosting

403 Error when trying to access Grav admin on local test server

Started by Deleted User 9 years ago · 6 replies · 2675 views
9 years ago

I am running Nginx and PHP on Windows 10. When I access 127.0.0.1 or 127.0.0.1/info.php, I get the Nginx welcome screen and PHP output, respectively, so it seems the system on which I am trying to run Grav-admin is working. This is just for a local testing environment, this is not being served publicly on the web. I am not using WAMP or any third party server administration, I just have PHP and NginX installed manually.

I was actually able to run Grav admin one time successfully. I created an account, logged in, and browsed some themes. I thought everything was set up perfectly. I did not make any changes or adjustments, I just clicked around to explore the interface.

However, that was Friday. I shut down the computer over the weekend, came back Monday, and now when I open 127.0.0.1/grav/index.php, I get a 403 Forbidden error. The rest of the system, the NginX and PHP, appear to be working as they did before. I don't think I changed anything, but it would appear that most likely something about rebooting the system has affected Grav's access rights or something.

How do I resolve this error so that I can once again open up the Grav admin interface?

9 years ago

Can you paste your nginx config? Is that the one shipped with Grav? Did you edit it? It should be

TXT
location / {
    try_files $uri $uri/ /index.php?_url=$uri&$query_string;
}

(reference: https://github.com/gantry/gantry5/issues/1748)

Try accessing 127.0.0.1/grav/, not 127.0.0.1/grav/index.php, something changes?

For reference here is a good list of common 403 nginx causes: https://www.1and1.com/cloud-community/learn/web-server/nginx/solve-an-nginx-403-forbidden-error/

9 years ago

Thanks for responding.

I put my Nginx conf file here on Pastebin.

I did edit it somewhat following advice of some different online tutorials, but I would not be able to separate out which changes came from which source, or which problem they were trying to solve.

9 years ago

My suggestion is to get things working with a simple configuration (like the one we include as webserver-config/nginx.conf in the Grav package. After it's working with that then feel free to 'slowly' enhance it to your needs.

9 years ago

Rhuk, thank you for responding.

Please note, it was never my intention to implement new features. The nginx.conf file I have was the result of simply trying to get NginX to work in the first place.

I'm not sure where you mean when you say there is a usable conf file in webserver-config/nginx.conf. Where exactly do I find that?

9 years ago

Thank you for responding. I reviewed the supplied configuration files, and using that as a reference, I discovered that if I removed the line root html; from my Nginx conf file, then Grav seems to work.

Thanks to everyone for their support.

Suggested topics

Topic Participants Replies Views Activity
Installation & Hosting · by antoinep, 11 hours ago
5 59 5 hours ago
Installation & Hosting · by Jürgen Dietrich, 7 months ago
0 60 7 months ago
Installation & Hosting · by rappluk, 8 months ago
0 61 8 months ago
Installation & Hosting · by N, 12 months ago
3 71 12 months ago
Installation & Hosting · by Youle, 1 year ago
1 60 1 year ago