Nginx Configuration virtual folder and URL redirection
server { #侦听80port listen 8090; #定义使用www. xx.com interview server_name 127.0.0.1; #设定本虚拟主机的訪问日志 access_log /var/log/nginx/access.log; Error_log /var/log/nginx/error.log; Root /home/lxy/www/cs/; #定义服务器的默认站点根文件夹位置 #默认请求 Location /{ index index.php index.html index.htm; #定义首页索引文件的名称 if (!-e $request _filename) { rewrite ^/(. *) $/index.php?Last; break; } } #PHP script requests all forwarding to fastcgi processing. Use the fastcgi default configuration. Location ~ \.php$ { Fastcgi_pass 127.0.0.1:9000; Fastcgi_index index.php; Fastcgi_param script_filename/home/lxy/www/cs/$fastcgi _script_name; Include Fastcgi_params; } #禁止訪问. htxxx file Location- /\.ht { deny all; }}
if (!-e $request _filename) {
Rewrite ^/(. *) $/index.php?$1 last;
Break
} I
is to rewrite the URL. The rewritten URL is able to access the Web site via Http://127.0.0.1:8090/index.php/Page/index
Nginx Config Web virtual folder and codeigniter,thinkphp redirect URL address