技术文档

Nginx泛解析的匹配域名绑定到子目录配置

 

Nginx泛解析的匹配域名绑定到子目录配置

Nginx泛解析的匹配域名绑定到子目录配置,有2种方法,推荐方法一

方法一:

  1. server{
  2. listen80;
  3. server_name~^(?<subdomain>.+).$;
  4. access_log/data/wwwlogs/_nginx.logcombined;
  5. indexindex.htmlindex.htmindex.php;
  6. root/home/wwwroot/linuxeye/$subdomain/;
  7. location~.php${
  8. fastcgi_passunix:/dev/shm/php-cgi.sock;
  9. fastcgi_indexindex.php;
  10. fastcgi_paramSCRIPT_FILENAME$document_root$fastcgi_script_name;
  11. includefastcgi_params;
  12. }
  13. location~.*\.(gif|jpg|jpeg|png|bmp|swf|flv|ico)${
  14. expires30d;
  15. }
  16. location~.*\.(js|css)?${
  17. expires7d;
  18. }
  19. }
©2020-2024   万云SSL证书  (www.sslssl.com.cn)  万云科技   豫ICP备2020034358号-10