laravel 指定路由换root

in 前端 with 0 comment
server {
  listen 80;
  server_tokens off;
  server_name xx.com;
  root /var/www/xx.com/public;
  index index.php index.html index.htm;

  location ~ \.php$ {
        if ($query_string ~* "^local") {
            root /var/www/yy.com/public;
        }
        
        include fastcgi_params;
        include conf.d/fastcgi.d/fastcgi_php_71;
        include conf.d/fastcgi.d/fastcgi_web;
        include conf.d/fastcgi.d/fastcgi_mysql;
        include conf.d/fastcgi.d/fastcgi_redis;
        include conf.d/fastcgi.d/fastcgi_mongo;
        include conf.d/fastcgi.d/fastcgi_rabbitmq;
        include conf.d/fastcgi.d/fastcgi_es;
        include conf.d/fastcgi.d/fastcgi_ldap;
  }

  location ~* \.(jpg|jpeg|gif|css|png|js|ico|html)$ {
    access_log off;
    expires max;
  }

  location ~ /(\.ht|\.git) {
    deny all;
  }

  if (!-e $request_filename) {
    rewrite ^/(.*)$ /index.php?$1 last;
  }
}
Comments are closed.