加入收藏 | 设为首页 | 会员中心 | 我要投稿 开发网_开封站长网 (http://www.0378zz.com/)- 科技、AI行业应用、媒体智能、低代码、办公协同!
当前位置: 首页 > 站长学院 > PHP教程 > 正文

Laravel Nginx配置步骤介绍

发布时间:2022-06-08 14:16:54 所属栏目:PHP教程 来源:互联网
导读:这是一个Laravel框架运行nginx服务器的配置示例,Laravel框架版本5.2. server { listen 80; server_name localhost; root /usr/share/nginx/html/tanteng.me/public; index index.php index.html index.htm; location / { try_files $uri $uri/ /index.php?$
  这是一个Laravel框架运行nginx服务器的配置示例,Laravel框架版本5.2.
 
  server {
      listen       80;
      server_name  localhost;
      root   /usr/share/nginx/html/tanteng.me/public;
      index index.php index.html index.htm;
   
       location / {
          try_files $uri $uri/ /index.php?$query_string;
      }
   
      #error_page  404              /404.html;
   
      # redirect server error pages to the static page /50x.html
      #
      error_page   500 502 503 504  /50x.html;
      location = /50x.html {
          root   /usr/share/nginx/html/tanteng.me/public;
      }
   
      # proxy the PHP scripts to Apache listening on 127.0.0.1:80
      #
      #location ~ .php$ {
      #   proxy_pass   http://127.0.0.1;
      #}
   
      # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
      #
      location ~ .php$ {
          fastcgi_pass   127.0.0.1:9000;
          fastcgi_index  index.php;
          fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
          include        fastcgi_params;
      }
   
       }
  }
  运行在CentOS 7环境,Nginx版本1.8.
 
 

(编辑:开发网_开封站长网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    热点阅读