官术网_书友最值得收藏!

  • NGINX Cookbook
  • Tim Butler
  • 97字
  • 2021-07-03 00:04:31

How to do it...

As Laravel is PHP based, we'll be using PHP-FPM to compile the PHP code and present to NGINX. If this is new to you, it's worth reading through Chapter 2, Common PHP Scenarios which covers some of the other PHP scenarios and the PHP-FPM configuration.

To get going, we'll create a separate virtual configuration file for Laravel:

server { 
    listen       80; 
    server_name  laravel.nginxcookbook.com; 
    access_log  /var/log/nginx/laravel.access.log  combined; 
    index index.php; 
 
    root   /var/www/vhosts/laraveldemo/public; 
 
    location / { 
        try_files $uri $uri/ /index.php?$args; 
    } 
 
    location ~ \.php$ { 
        fastcgi_pass unix:/var/run/php7.0-fpm.sock; 
        fastcgi_index index.php; 
        fastcgi_param SCRIPT_FILENAME 
$document_root$fastcgi_script_name; include fastcgi_params; } }
主站蜘蛛池模板: 青神县| 黔江区| 海口市| 丹凤县| 盱眙县| 青田县| 盐边县| 文成县| 安达市| 阿鲁科尔沁旗| 手机| 临安市| 沅陵县| 阳东县| 旅游| 阿勒泰市| 揭阳市| 江油市| 台南市| 友谊县| 永清县| 老河口市| 革吉县| 衡水市| 西和县| 纳雍县| 高密市| 同仁县| 鹤峰县| 馆陶县| 平凉市| 辉县市| 永宁县| 明光市| 潼关县| 嵊泗县| 英吉沙县| 玉林市| 错那县| 琼中| 璧山县|