NGINX.conf配置文件支持pathinfo

NGINX.conf配置文件支持pathinfo

#  power by www.php.cn
#user  nobody;
worker_processes  1;

#error_log  logs/error.log;
#error_log  logs/error.log  notice;
#error_log  logs/error.log  info;

#pid        logs/nginx.pid;


events {
    worker_connections  4096;
}


http {
    include       mime.types;
    default_type  application/octet-stream;

    #log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
    #                  '$status $body_bytes_sent "$http_referer" '
    #                  '"$http_user_agent" "$http_x_forwarded_for"';

    #access_log  logs/access.log  main;

    sendfile        on;
    #tcp_nopush     on;

    #keepalive_timeout  0;
    keepalive_timeout  65;
    #tcp_nodelay on;
  fastcgi_connect_timeout 300;
  fastcgi_send_timeout 300;
  fastcgi_read_timeout 300;
  fastcgi_buffer_size 128k;
  fastcgi_buffers 4 128k;
  fastcgi_busy_buffers_size 256k;
  fastcgi_temp_file_write_size 256k;

  #gzip  on;
  gzip on;
  gzip_min_length  1k;
  gzip_buffers     4 32k;
  gzip_http_version 1.1;
  gzip_comp_level 2;
  gzip_types       text/plain application/x-javascript text/css application/xml;
  gzip_vary on;
  gzip_disable "MSIE [1-6].";

  server_names_hash_bucket_size 128;
  client_max_body_size     100m; 
  client_header_buffer_size 256k;
  large_client_header_buffers 4 256k;

    server {
        listen       80;
        server_name  localhost;

        #charset koi8-r;

        #access_log  logs/host.access.log  main;
        root    "D:/phpstudy/PHPTutorial/WWW";
        location / {
            index  index.html index.htm index.php l.php;
           autoindex  off;
        }

        #error_page  404              /404.html;

        # redirect server error pages to the static page /50x.html
        #
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }

        # proxy the PHP scripts to Apache listening on 127.0.0.1:80
        #
        #location ~ \.php$ {
    
        #    proxy_pass   http://127.0.0.1;
        #}

        # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
        #
        location ~ \.php(.*)$  {
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_index  index.php;
            fastcgi_split_path_info  ^((?U).+\.php)(/?.+)$;
            fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
            fastcgi_param  PATH_INFO  $fastcgi_path_info;
            fastcgi_param  PATH_TRANSLATED  $document_root$fastcgi_path_info;
            include        fastcgi_params;
        }

        # deny access to .htaccess files, if Apache's document root
        # concurs with nginx's one
        #
        #location ~ /\.ht {
    
        #    deny  all;
        #}
    }
    
############################
    #以下是移民虚拟主机配置
    server {
        listen       80;
        server_name  hzym.com;
        root    "D:\phpstudy\PHPTutorial\WWW\www.welltrend.com.cn\www";
        
          location / { 
          index  index.php index.html index.htm;
       if (!-e $request_filename) {
       rewrite  ^(.*)$  /index.php?s=$1  last;
       break;
        }
     }
        
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }

       
        location ~ \.php(.*)$  {
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_index  index.php;
            fastcgi_split_path_info  ^((?U).+\.php)(/?.+)$;
            fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
            fastcgi_param  PATH_INFO  $fastcgi_path_info;
            fastcgi_param  PATH_TRANSLATED  $document_root$fastcgi_path_info;
            include        fastcgi_params;
            include        fastcgi.conf;
        }
    }
    server {
        listen       80;
        server_name  m.hzym.com;
        root    "D:\phpstudy\PHPTutorial\WWW\www.welltrend.com.cn\www";
        
          location / { 
          index  index.php index.html index.htm;
       if (!-e $request_filename) {
       rewrite  ^(.*)$  /index.php?s=$1  last;
       break;
        }
     }
        
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }

       
        location ~ \.php(.*)$  {
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_index  index.php;
            fastcgi_split_path_info  ^((?U).+\.php)(/?.+)$;
            fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
            fastcgi_param  PATH_INFO  $fastcgi_path_info;
            fastcgi_param  PATH_TRANSLATED  $document_root$fastcgi_path_info;
            include        fastcgi_params;
        }
    }
###############以下是留学虚拟主机配置#############
        server {
                listen       80;
                server_name  lx.com;
                root    "D:\phpstudy\PHPTutorial\WWW\liuxue";
                
                
               location / {
                    index  index.php index.html index.htm;
                    if (!-e $request_filename) {
                        rewrite  ^(.*)$  /index.php?s=$1  last;
                        break;
                    }
                }
                
                error_page   500 502 503 504  /50x.html;
                location = /50x.html {
                    root   html;
                }

               
                location ~ \.php(.*)$  {
                    fastcgi_pass   127.0.0.1:9000;
                    fastcgi_index  index.php;
                    fastcgi_split_path_info  ^((?U).+\.php)(/?.+)$;
                    fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
                    fastcgi_param  PATH_INFO  $fastcgi_path_info;
                    fastcgi_param  PATH_TRANSLATED  $document_root$fastcgi_path_info;
                    include        fastcgi_params;
                }
            }

#留学移动端虚拟主机配置#
        server {
                listen       80;
                server_name  m.lx.com;
                root    "D:\phpstudy\PHPTutorial\WWW\m.welltrend-edu.com\public";
                
                
               location / {
                    index  index.php index.html index.htm;
                    if (!-e $request_filename) {
                        rewrite  ^(.*)$  /index.php?s=$1  last;
                        break;
                    }
                }
                
                error_page   500 502 503 504  /50x.html;
                location = /50x.html {
                    root   html;
                }

               
                location ~ \.php(.*)$  {
                    fastcgi_pass   127.0.0.1:9000;
                    fastcgi_index  index.php;
                    fastcgi_split_path_info  ^((?U).+\.php)(/?.+)$;
                    fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
                    fastcgi_param  PATH_INFO  $fastcgi_path_info;
                    fastcgi_param  PATH_TRANSLATED  $document_root$fastcgi_path_info;
                    include        fastcgi_params;
                }
            }
########################################
##########################laravel  #
        
            server {
                listen       80;
                #server_name  blog.com;   #暂时关闭这个域名
                #root    "D:\phpstudy\PHPTutorial\WWW\laravel\blog\public";
                
                
               location / {
                     index  index.php server.php index.html index.htm ;
                       try_files $uri $uri/ /index.php?$query_string;
                    if (!-e $request_filename) {
                        rewrite  ^(.*)$  /index.php?s=$1  last;
                        break;
                    }
                }
                
                error_page   500 502 503 504  /50x.html;
                location = /50x.html {
                    root   html;
                }
                location ~ \.php(.*)$  {
                    fastcgi_pass   127.0.0.1:9000;
                    fastcgi_index  index.php;
                    fastcgi_split_path_info  ^((?U).+\.php)(/?.+)$;
                    fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
                    fastcgi_param  PATH_INFO  $fastcgi_path_info;
                    fastcgi_param  PATH_TRANSLATED  $document_root$fastcgi_path_info;
                    include        fastcgi_params;
                }
               
            }
            #weibo jiekou 
            server {
                listen       80;
                server_name  test.open.lixiaowang.top;
                root    "D:\phpstudy\PHPTutorial\WWW\laravel\blog\public";
                
                
               location / {
                     index  index.php server.php index.html index.htm ;
                       try_files $uri $uri/ /index.php?$query_string;
                    if (!-e $request_filename) {
                        rewrite  ^(.*)$  /index.php?s=$1  last;
                        break;
                    }
                }
                
                error_page   500 502 503 504  /50x.html;
                location = /50x.html {
                    root   html;
                }
                location ~ \.php(.*)$  {
                    fastcgi_pass   127.0.0.1:9000;
                    fastcgi_index  index.php;
                    fastcgi_split_path_info  ^((?U).+\.php)(/?.+)$;
                    fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
                    fastcgi_param  PATH_INFO  $fastcgi_path_info;
                    fastcgi_param  PATH_TRANSLATED  $document_root$fastcgi_path_info;
                    include        fastcgi_params;
                }
               
            }
            
###################weibo#####################
server {
                listen       80;
                #server_name  test.open.lixiaowang.top;
                root    "D:\phpstudy\PHPTutorial\WWW\2018bak/libweibo-master/";
                
                
               location / {
                     index  index.php server.php index.html index.htm ;
                       try_files $uri $uri/ /index.php?$query_string;
                    if (!-e $request_filename) {
                        rewrite  ^(.*)$  /index.php?s=$1  last;
                        break;
                    }
                }
                
                error_page   500 502 503 504  /50x.html;
                location = /50x.html {
                    root   html;
                }
                location ~ \.php(.*)$  {
                    fastcgi_pass   127.0.0.1:9000;
                    fastcgi_index  index.php;
                    fastcgi_split_path_info  ^((?U).+\.php)(/?.+)$;
                    fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
                    fastcgi_param  PATH_INFO  $fastcgi_path_info;
                    fastcgi_param  PATH_TRANSLATED  $document_root$fastcgi_path_info;
                    include        fastcgi_params;
                }
               
            }
###################QQ登录#####################
server {
                listen       80;
                server_name qq.open.lixiaowang.top;
                root    "D:\phpstudy\PHPTutorial\WWW\2018bak/qqConnect2.1/";
                
                
               location / {
                     index  index.php server.php index.html index.htm ;
                       try_files $uri $uri/ /index.php?$query_string;
                    if (!-e $request_filename) {
                        rewrite  ^(.*)$  /index.php?s=$1  last;
                        break;
                    }
                }
                
                error_page   500 502 503 504  /50x.html;
                location = /50x.html {
                    root   html;
                }
                location ~ \.php(.*)$  {
                    fastcgi_pass   127.0.0.1:9000;
                    fastcgi_index  index.php;
                    fastcgi_split_path_info  ^((?U).+\.php)(/?.+)$;
                    fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
                    fastcgi_param  PATH_INFO  $fastcgi_path_info;
                    fastcgi_param  PATH_TRANSLATED  $document_root$fastcgi_path_info;
                    include        fastcgi_params;
                }
               
            }
            
########################################

    # another virtual host using mix of IP-, name-, and port-based configuration
    #
    #server {
    
    #    listen       8000;
    #    listen       somename:8080;
    #    server_name  somename  alias  another.alias;

    #    location / {
    
    #        root   html;
    #        index  index.html index.htm;
    #    }
    #}


    # HTTPS server
    #
    #server {
    
    #    listen       443;
    #    server_name  localhost;

    #    ssl                  on;
    #    ssl_certificate      cert.pem;
    #    ssl_certificate_key  cert.key;

    #    ssl_session_timeout  5m;

    #    ssl_protocols  SSLv2 SSLv3 TLSv1;
    #    ssl_ciphers  HIGH:!aNULL:!MD5;
    #    ssl_prefer_server_ciphers   on;

    #    location / {
    
    #        root   html;
    #        index  index.html index.htm;
    #    }
    #}

include vhosts.conf;

}

 

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/112491.html原文链接:https://javaforall.net

(0)
全栈程序员-站长的头像全栈程序员-站长


相关推荐

  • vue.js单页应用_vue嵌入第三方页面

    vue.js单页应用_vue嵌入第三方页面今天我们看看VUE怎么开发单页面应用,VUE提供了脚手架vue-cli,通过这个可以很轻松的创建VUE单页面应用,1.创建VUE项目  首先确保电脑上安装了NODE.JS, 在创建项目的目录下,打开CMD命令行,执行脚手架命令,安装脚手架cli. #全局安装vue-cli,一定要在全局模式下安装vue-cli,否则无法使用vue命令npminstall-gvue…

    2022年10月13日
    0
  • java连接MySQL数据库的驱动jar包

    java连接MySQL数据库的驱动jar包mysql官网:https://dev.mysql.com/步骤1步骤2步骤3步骤4或者直接点击这个链接直接到这个页面https://dev.mysql.com/downloads/connector/j/在这个页面再点击弹出的下拉列表这个点击PlatformIndependent然后点击第二个下载在出现的页面点击Nothanks,juststartmydownload即可下载不用登陆我们只下载就行然后将下载的压缩文件导入idea中即可了!手动截图不易点

    2022年5月21日
    35
  • 激光SLAM原理_激光打标机

    激光SLAM原理_激光打标机在机器人运动控制系统架构中,可分为最底层、中间通信层和决策层三大层面,最底层包含了机器人本身的电机驱动和控制部分,中间通信层是底层部分和决策层的通信通路,而决策层则是实现机器人的定位建图及导航。在机器人定位导航中,目前主要涉及到激光SLAM与视觉SLAM,激光SLAM在理论、技术和产品落地上都较为成熟,因而成为现下最为主流的定位导航方式,在家用扫地机器人及商用送餐机器人等服务机器人中普遍采用了…

    2022年8月23日
    2
  • Thinkphp 加载更多

    Thinkphp 加载更多

    2021年10月30日
    54
  • 自动化测试 数据驱动(自动化测试解决数据错误)

    数据驱动将测试数据和测试行为完全分离,实施数据驱动测试步骤如下:A、编写测试脚本,脚本需要支持从程序对象、文件或者数据库读入测试数据;B、将测试脚本使用的测试数据存入程序对象、文件或者数据库等外部介质中;C、运行脚本过程中,循环调用存储在外部介质中的测试数据;D、验证所有的测试结果是否符合预期结果; 1、使用unittest和ddt进行数据驱动:#-*-coding…

    2022年4月18日
    40
  • django urls_关于URL的作用

    django urls_关于URL的作用前言为什么我们url需要命名呢?url命名的作用是什么?我们先来看一个案例案例我们先在一个Django项目中,创建2个App,前台front和后台cms,然后在各自app下创建urls.py文件

    2022年7月28日
    4

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号