搭建TP5项目nginx配置

2020-04-14  本文已影响0人  zhaoxiaohui520

thinkphp5.1官网推荐配置

按照官网要求做的全部配置代码:

server { 
    listen   80 ; 
    server_name  www.d5.com; 
    root /var/www/tptest/public; 
    index index.php index.html ; 
    location / { 
       if (!-e $request_filename) { 
           rewrite  ^(.*)$  /index.php?s=/$1  last; 
       } 
    } 
    location ~ \.php { 
        include fastcgi_params; 
        fastcgi_pass   127.0.0.1:9000; 
        fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name; 
        fastcgi_param  PATH_INFO  $fastcgi_path_info; 
        fastcgi_param  PATH_TRANSLATED  $document_root$fastcgi_path_info; 
    } 
} 
上一篇 下一篇

猜你喜欢

热点阅读