nginx+yii2

代码语言:javascript
复制

 user  nginx;
 worker_processes  auto;
#error_log  logs/error.log;
 #error_log  logs/error.log  notice;
 #error_log  logs/error.log  info;
#pid        logs/nginx.pid;

 events {
     worker_connections  1024;
 }

 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;
    server_names_hash_bucket_size 512;
     client_header_buffer_size 32k;
     large_client_header_buffers 4 32k;
     client_max_body_size 50m;

     fastcgi_connect_timeout 300;
     fastcgi_send_timeout 300;
     fastcgi_read_timeout 300;
     fastcgi_buffer_size 64k;
     fastcgi_buffers 4 64k;
     fastcgi_busy_buffers_size 128k;
     fastcgi_temp_file_write_size 256k;
     fastcgi_intercept_errors on;
server{
     listen 80; 
     include /var/www/html/store/web/.htaccess ;
     server_name shop.labike.xyz; #绑定域名  
     location / {  
         root   /var/www/html/store/web;  
         index  index.php index.html index.htm;
     try_files $uri $uri/ /index.php$is_args$args;
 
 
     }  
     location ~ \.php$ {  
         root           /var/www/html/store/web;  
         fastcgi_pass   127.0.0.1:9000;  
         fastcgi_index  index.php;  
         #fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;  
         fastcgi_param  SCRIPT_FILENAME  /var/www/html/store/web$fastcgi_script_name;  
         include        fastcgi_params;  
     }  
 }  
 
 }
 

yii2

代码语言:javascript
复制
'urlManager' => [
'enablePrettyUrl' => true,
'showScriptName' => false,
'rules' => [
],

],