nginx-php File not found

Source: Internet
Author: User
Configure the environment with Vagrant, but the dead and alive are ' file not found '
Vagrant version

Vagrant 1.6.5

Directory permissions are

drwxr-xr-x 1 vagrant vagrant

Nginx error message

[error] 2186#0: *32 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: 192.168.33.1, server: xxx.xxx.com, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:"

Nginx Configuration

    server {        listen   80; ## listen for ipv4; this line is default and implied        server_name xxx.xxx.com;        root /vagrant/demo;        index index.php;        # Make site accessible from http://localhost/        if (!-e $request_filename) {            rewrite ^(.*)$ /index.php$1 last;        }        location ~ [^/]\.php(/|$) {                fastcgi_split_path_info ^(.+?\.php)(/.*)$;                fastcgi_pass unix:/var/run/php5-fpm.sock;                fastcgi_index index.php;                fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;                include fastcgi_params;        }}

The internet has been tried, or not.

Reply content:

Configure the environment with Vagrant, but the dead and alive are ' file not found '
Vagrant version

Vagrant 1.6.5

Directory permissions are

drwxr-xr-x 1 vagrant vagrant

Nginx error message

[error] 2186#0: *32 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: 192.168.33.1, server: xxx.xxx.com, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:"

Nginx Configuration

    server {        listen   80; ## listen for ipv4; this line is default and implied        server_name xxx.xxx.com;        root /vagrant/demo;        index index.php;        # Make site accessible from http://localhost/        if (!-e $request_filename) {            rewrite ^(.*)$ /index.php$1 last;        }        location ~ [^/]\.php(/|$) {                fastcgi_split_path_info ^(.+?\.php)(/.*)$;                fastcgi_pass unix:/var/run/php5-fpm.sock;                fastcgi_index index.php;                fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;                include fastcgi_params;        }}

The internet has been tried, or not.

  • 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.