Server-nginxphp configuration-php Tutorial

Source: Internet
Author: User
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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.