码迷,mamicode.com
首页 > 其他好文 > 详细

nginx rewriter配置

时间:2014-05-16 19:46:26      阅读:316      评论:0      收藏:0      [点我收藏+]

标签:blog   class   code   c   a   com   

rewriter配置

nginx.conf配置

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
    server {
 
         listen  80;
         server_name 127.0.0.1;
         index index.php;
         root  /usr/share/nginx/html;
         #rewrite ^/projects/BookLibrary2/public$  /projects/BookLibrary2/public/index.php;
         #include /usr/share/sidamingzhu.conf;
              
         location / {
              
                                 if (!-e $request_filename) {
                                         rewrite ^/(.*)$ /projects/BookLibrary2/public/index.php last;
                                 }
          }         
              
        location ~ \.php$ {            #对.php文件调用php的fastcgi.exe处理
           #root html;
           fastcgi_pass   127.0.0.1:9000;
           fastcgi_index  index.php;
           fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
           include        fastcgi_params;
        }    
 
    }
 
}

  

fpm-php.conf需要配置監聽端口

1
#加在fpm-php.conf最後一行<br>listen = 127.0.0.1:9000

  

 

nginx rewriter配置,布布扣,bubuko.com

nginx rewriter配置

标签:blog   class   code   c   a   com   

原文地址:http://www.cnblogs.com/xiongwei89/p/3725394.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!