nginx.conf 配置文件新建域名訪問


server {
listen 80;
server_name www.huliangqing.com ; //域名地址
charset koi8-r;
access_log logs/huliangqing.log; //這個域名的日志
location / {
root /mnt/www/tplay/public;//共享文件框架的地址
index index.php index.html;//框架的入口文件

if (!-e $request_filename) {
rewrite ^(.*)$ /index.php?s=/$1 last;//偽靜態
break;}

location ~ \.php$ {
root/mnt/www/tplay/public;//也是框架的地址 好像是支持訪問php文件
fastcgi_pass 127.0.0.1:9000 ;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}

}
}



第二種

server {
  listen 80;
  server_name www.jixie.com;
  root "huliangqing/www/jixie/jixie/public";
  location / {
    index index.php index.html error/index.html;
      if (!-e $request_filename) {
      rewrite ^(.*)$ /index.php?s=/$1 last;
      break;
      }
      # autoindex off;
      }
  location ~ \.php(.*)$ {
    fastcgi_pass 127.0.0.1:9000;
    fastcgi_index index.php;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    fastcgi_param PATH_INFO $fastcgi_path_info;
    fastcgi_split_path_info ^((?U).+\.php)(/?.+)$;
    fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
    include fastcgi_params;
    }
}





本地新建域名進行訪問

 

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM