3

I'm working on setting up a development environment, but for some reason the fastcgi_index is not working. The difference between the production and dev environment is the listening port of nginx. Other than that, it's the same. In production, it's 80, and on dev it's 8080.

When I go to http://domain.com:8080, I get Forbidden 403 forbidden. If I put index in there, I get the file ie: http://domain.com:8080/index.php

Directory permission is 755 and index.php is readable by everyone. I don't think it's a permission issue since navigating directly to the file works.

This is what I have in the conf:

location ~ \.php$ {
            try_files $uri =404;
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_index index.php;
            include /etc/nginx/fastcgi.conf;
            fastcgi_read_timeout 180;
}

My guess it has to do something with the port 8080? Again, that should be the only difference between the 2 servers.

1 Answer 1

2

Have you declared root /index.php at server level?

Sign up to request clarification or add additional context in comments.

1 Comment

That was it. I didn't have it set in nginx.conf. Thanks!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.