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