Server {listen8080; server_namexxx.me; {code...} I have installed php and nginx. A www folder is created under the root directory. According to this configuration, I access xxx. me and return welcometong.pdf directly !. Then I created an index. h... server {Under the www folder {
Listen 8080;
Server_name xxx. me;
root /www/;index index.html index.htm index.php;location / { try_files $uri $uri/ /index.php;}location ~ \.php$ { try_files $uri =404; include fastcgi.conf; fastcgi_pass 127.0.0.1:9000;}
}
I have installed php and nginx. A www folder is created under the root directory. According to this configuration, I access xxx. me
Return Welcome to nginx !. After that, I created an index.html file under the www folder, which also prompted Welcome to nginx! This information, and I created an index. php and returned 404. Is it my configuration error. The nginx information is always returned. please tell me, a little Cainiao.
Reply content:
Server {
Listen 8080;
Server_name xxx. me;
root /www/;index index.html index.htm index.php;location / { try_files $uri $uri/ /index.php;}location ~ \.php$ { try_files $uri =404; include fastcgi.conf; fastcgi_pass 127.0.0.1:9000;}
}
I have installed php and nginx. A www folder is created under the root directory. According to this configuration, I access xxx. me
Return Welcome to nginx !. After that, I created an index.html file under the www folder, which also prompted Welcome to nginx! This information, and I created an index. php and returned 404. Is it my configuration error. The nginx information is always returned. please tell me, a little Cainiao.
location ~ \.php$ { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; }
Modify this part here. this is the default configuration after nginx is installed.
Simple configuration of centos + nginx + php-fpm + mysql