zoukankan      html  css  js  c++  java
  • nginx 配置web 虚拟文件夹 而且codeIgniter,thinkphp 重定向url 地址

    nginx 配置虚拟文件夹而且url 重定向


    server {
        #侦听80port
            listen 8090;
            #定义使用www.xx.com訪问
            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?

    $1 last; break; } } #PHP 脚本请求所有转发到 FastCGI处理. 使用FastCGI默认配置. 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 文件 location ~ /.ht { deny all; } }


    当中   if (!-e $request_filename) {
                    rewrite ^/(.*)$ /index.php?$1 last;
                     break;
                 } i

    就是对 url 重写。重写后的url 能够通过   http://127.0.0.1:8090/index.php/Page/index  訪问web 站点

  • 相关阅读:
    最短路小变形
    最短路
    bfs + 路径输出
    优先队列
    dijkstra
    重载运算符-operator
    最短路
    二分图匹配
    依赖型的关系建立
    string 类
  • 原文地址:https://www.cnblogs.com/gcczhongduan/p/5350529.html
Copyright © 2011-2022 走看看