PHP Settings: Nginx Server pseudo-static how to set?

Source: Internet
Author: User
Tags nginx server

 In the Nginx server set UWA pseudo-static, you need to modify Nginx configuration file. PHP Settings section: Location ~ \.php {# The following two behaviors to avoid, *.php file does not exist, and php-fpm (PHP FastCGI) returned no input file specified error, direct point to the site root directory

Enterprise Template site Sharing

In the Nginx server set UWA pseudo-static, you need to modify Nginx configuration file.

PHP Settings section:
Location ~ \.php {
# The following two behaviors to avoid, *.php file does not exist, and PHP-FPM (PHP FastCGI) return no input file specified error, direct point to the site root directory 404.html
Try_files $uri/www/lib/404/404.error.html;
Fastcgi_intercept_errors off;
Fastcgi_pass 127.0.0.1:1234; #1234根据自己的PHP端口设置
Fastcgi_index index.php;
Fastcgi_param script_filename $document _root$fastcgi_script_name;
Include Fastcgi_params;
# The following is to allow Nginx to support path_info
Set $path _info "";
Set $real _script_name $fastcgi _script_name;
if ($fastcgi _script_name ~ "^ (. +?\.php) (/.+) $") {
Set $real _script_name $;
Set $path _info;
}
Fastcgi_param script_filename $document _root$real_script_name;
Fastcgi_param script_name $real _script_name;
Fastcgi_param path_info $path _info;
Fastcgi_connect_timeout 120;
Fastcgi_send_timeout 120;
Fastcgi_read_timeout 120;
Fastcgi_buffers 8 128K;
Fastcgi_buffer_size 128K;
}
Site section:
server {
Listen 80;
server_name asthis.net; #网站域名
Root/www/root/uwa; #网站根目录
CharSet UTF-8; #网站编码
Location/{
if (!-e $request _filename) {#如果没有找到相应文件
Rewrite ^/(. *) $/index.php/$1 last; #设置伪静态规则
}
Index index.php;
}
Include PHP;
Include error;
}

PHP Settings: Nginx Server pseudo-static how to set?

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.