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

  • 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; } }
主站蜘蛛池模板: 宁武县| 且末县| 栾川县| 江油市| 徐汇区| 榕江县| 樟树市| 开江县| 开原市| 怀化市| 泾阳县| 兰坪| 泉州市| 奉贤区| 东港市| 上杭县| 尉氏县| 高要市| 东乡族自治县| 波密县| 泗阳县| 西林县| 子洲县| 顺义区| 玉屏| 揭东县| 台山市| 鹤壁市| 大丰市| 满洲里市| 吉安市| 富阳市| 治多县| 灌南县| 贵德县| 红安县| 塘沽区| 阳谷县| 延长县| 醴陵市| 上思县|