server { listen 80; server_name blog.sweetsunnyflower.com; index index.html index.htm index.php; charset utf-8; # 项目1 location ^~ /project1/ { alias /var/www/project1/public/; try_files $uri $uri/ @project1; location ~ \.php$ { fastcgi_pass unix:/run/php/php7.1-fpm.sock; fastcgi_index index.php; #fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param SCRIPT_FILENAME $request_filename; include fastcgi_params; } } location @project1 { rewrite /project1/(.*)$ /project1/index.php?/$1 last; } # 项目2 location ^~ /project2/ { alias /var/www/project2/public/; try_files $uri $uri/ @project2; location ~ \.php$ { fastcgi_pass unix:/run/php/php7.1-fpm.sock; fastcgi_index index.php; #fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param SCRIPT_FILENAME $request_filename; include fastcgi_params; } } location @project2 { rewrite /project2/(.*)$ /project2/index.php?/$1 last; } access_log /var/log/nginx/access.log; error_log /var/log/nginx/error.log error; sendfile off; }

  

相关文章:

  • 2021-10-17
  • 2022-12-23
  • 2021-10-14
  • 2022-12-23
  • 2021-11-17
  • 2022-12-23
  • 2021-11-08
猜你喜欢
  • 2022-01-23
  • 2021-10-09
  • 2021-06-09
  • 2021-05-11
  • 2021-04-06
相关资源
相似解决方案