zqcolor

zqcolor

这家伙有点懒,还没写个性签名!

  • 财富值105
  • 威望值0
  • 总积分165

个人信息

  • 下面我测试工作的, centos7+php5.6w+nginx1.63
    yii2 advanced 的版本

    xxx.xxx.xxx 换成你的域名
    主要是"location /" 里面的东西rewrite rules重要

    
    
       server {
            listen       80 default_server;
            #listen       [::]:80 default_server;
            server_name  xxx.xxx.xxx;
            root         /usr/share/nginx/html/yii-application/frontend/web/;
    		index index.php index.html index.htm;
    
            # Load configuration files for the default server block.
            include /etc/nginx/default.d/*.conf;
    
    			   location / {
    					   # Redirect everything that isn't a real file to index.php
    					   #try_files $uri $uri/ /index.php?$is_args$args;
    					   try_files $uri $uri/ /index.php?$args;
    
    						 #rewrite rules  #autoindex  on ;
    						 if (!-e $request_filename){
    							rewrite ^/(.*) /index.php?r=$1 last;
    						}
    					
    
    					   }
    
    
    		   location ~ \.php$ {
                fastcgi_split_path_info ^(.+\.php)(/.+)$;
                # With php5-fpm:
                fastcgi_pass unix:/run/php-fpm/php5-fpm.sock;
                fastcgi_index index.php;
                include fastcgi.conf;
    		}
    
    	
    		
    	
    		location /phpMyAdmin {
    			alias /usr/share/nginx/html/phpMyAdmin;
    			index index.php index.html index.htm;
    		}
    		
    		location ~ /phpMyAdmin/.*\.php$ {
    			fastcgi_pass    127.0.0.1:9000;
    			fastcgi_index   index.php;
    			fastcgi_param   SCRIPT_FILENAME /usr/share/nginx/html/$uri;
    			include     fastcgi_params;
    		}
    
    		
            error_page 404 /404.html;
                location = /40x.html {
            }
    
            error_page 500 502 503 504 /50x.html;
                location = /50x.html {
            }
        }
    
    
  • zhjyang
    zhjyang 评论于 2016-03-02 13:41举报

    来点个赞,准备学习下

  • zhjyang
    zhjyang 评论于 2016-03-02 13:41举报

    来点个赞,准备学习下

助理 等级规则
165/200
资料完整度
10/100
用户活跃度
10/100

Ta的关注

3

Ta的粉丝

2

Ta的访客

4