在nginx配置文件中,可以在nginx总体的配置文件nginx.conf中,也可以在单独的网站配置环境中进行设置,如:www.tomener.com.conf

在配置环境server段location中添加相应的配置信息:

location ~ \.php($|/) {
    try_files         $uri =404;
    fastcgi_pass      unix:/tmp/php-cgi.sock;
    fastcgi_index     index.php;
    include           fastcgi_params;
    fastcgi_param     SCRIPT_FILENAME  $document_root$fastcgi_script_name;
    fastcgi_param     RUNTIME_ENVIROMENT 'PRO'; # PRO or DEV
}

这里只添加了fastcgi_param RUNTIME_ENVIROMENT 'PRO'一个值,更多可以添加在后面

然后重启重启nginx

 
nginx -s reload

相关文章:

  • 2021-07-04
  • 2022-02-07
猜你喜欢
  • 2022-01-06
  • 2021-11-13
  • 2022-01-30
  • 2021-05-22
  • 2022-12-23
  • 2022-12-23
  • 2021-08-15
相关资源
相似解决方案