A
A
Alexander2016-12-12 15:10:37
Nginx
Alexander, 2016-12-12 15:10:37

nginx not seeing php file?

vim /etc/nginx/site-available/my-sit.com

server {
    listen 80;
    listen 443 ssl;
    server_name my-site.local;
    root "/var/www/my-site.local/public";

    index index.html index.htm index.php;

    charset utf-8;

    location / {
        try_files $uri $uri/ /index.php?$query_string;
    }

    location = /favicon.ico { access_log off; log_not_found off; }
    location = /robots.txt  { access_log off; log_not_found off; }
.....

The first time this path /var/www/my-site.local/public created an index.html file with the content Hello world. Checked everything plows. Then I deleted index.html and went to the site my-site.local 403 error, okay. Then I created index.php with the content:
<?php
phpinfo();
?>

I go to the site but it shows Hello world. I cleared the cache but the problem is the same. Why does it show me the already deleted index.html ?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
2
24-shops 24-shops, 2016-12-12
@kentuck1213

Change these lines
to this
index index.php index.html index.htm;

T
TocTbIP, 2020-06-25
@TocTbIP

Good afternoon! I have the same nonsense, I did the same thing on the link, but everything is exactly the same when I start, the error is true 404 Not Found, when I go to ip or domain name, Nginx gives out "Welcome to nginx!" when going to 192.168.0.100/index.php an error occurred.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question