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

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; } }
主站蜘蛛池模板: 祁东县| 鸡泽县| 秦安县| 鸡西市| 永川市| 清丰县| 嘉禾县| 鄄城县| 宿迁市| 朝阳区| 阳曲县| 六枝特区| 岢岚县| 阜平县| 东方市| 班玛县| 崇仁县| 开阳县| 宁蒗| 商丘市| 田阳县| 天峻县| 淄博市| 通海县| 略阳县| 津南区| 奇台县| 中西区| 灵丘县| 阿拉善左旗| 潮安县| 盐津县| 东乡| 平遥县| 太仆寺旗| 屏东市| 织金县| 凯里市| 内黄县| 喀喇沁旗| 佳木斯市|