Configure the NGINX+PHP-FPM, visit the homepage, prompt error:2015/01/14 23:04:39 [ERROR] 10964#2788: * * Rewrite or internal redirection cycle while internally redirecting to "/", Clie nt:127.0.0.1, SERVER:BK, Request: "get/http/1.1", Host: "BK"cause of Error:index instruction, solution to try_files $uri $uri/; Change to Try_files $uri $uri/= 404;Special Note:There can be no spaces between the =404 equals
ThinkPHP can configure the URL_MODEL option in app/Conf/config. php. There are three types:1. URL_MODEL => 1. pathinfo is supported by default.2. URL_MODEL => 2. url rewriting mode is implemented by configuring url rewriting.3. URL_MODEL => 3. URL compatibility mode. The URL must be dynamically generated using the U method.Here, we select 2, configure the url rewrite mode, and then Configure nginx:# Load th
This article is for everyone to explain is Ubuntu under the installation nginx error error:the HTTP rewrite module requires the PCRE Library solution, interested students under reference.
error Description:
Ubuntu installation nginx prompt error:the HTTP rewrite module requires the P
Nginx is implemented with a renaming method when handling more than 9 parameters: /?m? ( [0-9,]*) H? (\d*) A? ([0-9,]*) c? (\d*) s? (x?f? (? p/$/index.php? param1=$1param2=$2 param3=$3param4=$4param5=$5 param6=$6param8=$8param9=$9param10= $f last; Notice that the 10th parameter F is passed? Pf? pparam10= $f After the addition of param11= $j. Nginx does not have a modifier similar to Apache
Search on the Internet many methods do not work, research one day, found that the following configuration can be perfect support for ' Url_model ' => 2 of the situation
Copy Code code as follows:
location/project/{
Index index.php;
if (!-e $request _filename) {
Rewrite ^/project/(. *) $/project/index.php/$1 last;
Break
}
}
Location ~. +\.php ($|/) {
Set $script $uri;
Set $path _info "/";
if ($uri ~ "^ (. +\.php)
Ask for a simple pseudo static Nginx Rewrite such as http://www.a.com/a.php? The number behind id = 2id is variable nbsp; I need to rewrite to nbsp; http://s.a.com/a.php? Id = 2 access the http://www.a.com to find a simple pseudo static Nginx Rewrite
For example
Http://w
Server {Listen80; server_name www. funsion.com; Root/www/web/funsion; Index index.PHP; #disable access to PHP files in the app directoryLocation ~* ^/application/.+\.php$ {#The . HTML in this directory is allowed to be accessed because the static HTML cache is also generated under this directory return403; } Location~* ^/application/tpl/.+\.html$ {return403;#disable access to HTML files under the template directory } #prohibit access to files in the thinkphp directoryLocation ~*
Locate the/usr/local/webserver/nginx/conf/nginx.conf file (environment configuration is different, the path may not be the same)And in the server {... Omitted code to add the following code (if the program is placed in the root directory with a first-level directory code, placed in the level two directory, please use the level two directory code), and then restart Nginx:############## #开启pathinfo支持(Please i
Nginx redirection rules
Nginx redirection uses the HttpRewriteModule of Nginx. The following describes how to use it:Rewrite command
Nginx rewrite is equivalent to apache rewriterule (in most cases, the original apache
Allow Nginx to support thinkphp URL rewriting and PathInfo
Enable the thinkphp to operate correctly on Nginx.
Simply add the following information in the configuration file to allow Nginx to parse the thinkphp website correctly.
?
?
location/project/ { index index.php; if (!-e $request _filename) {
Allow Nginx to support thinkphp URL rewriting and PathInfo
Enable the thinkphp to operate correctly on Nginx.
Simply add the following information in the configuration file to allow Nginx to parse the thinkphp website correctly.
?
?
location/project/ { index index.php; if (!-e $request _filename) {
Rewrite the configuration url in nginx! Hostnameinforindex. php? Qssqhostnamessq_index.html I want to rewrite the above url to the following format. thank you! ------ Solution ------------------ lt; IfModulemod_rewrite.c gt; configure url rewriting in nginx!
Hostname/infor/index. php? Q = ssq
Hostname/ssq_index.htm
Rewrite the configuration url in nginx! Hostname/infor/index. php? Q = ssqhostname/ssq_index.html I want to rewrite the above url to the following format. thank you !, Lt; IfModulemod_rewrite.c gt; configure url rewriting in RewriteEngineOnRewr nginx!
Hostname/infor/index. php? Q = ssq
Hostname/ssq_index.html
I wa
Nginx+php often need to use pseudo static, generally we are manually set. Is there any way to make nginx automatically fill the full path?These two days have been a long time to achieve such a function:Request/A/B/CIf the file does not exist, look for/a/b/index.php,/c as Path_info;If the file does not exist, look for/a/index.php,/b/c as Path_info;If the file does not exist, look for/index.php,/a/b/c as Path
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.