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

  • 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; } }
主站蜘蛛池模板: 临高县| 太湖县| 沐川县| 赫章县| 黄陵县| 崇义县| 涟源市| 五大连池市| 通榆县| 时尚| 罗源县| 封丘县| 景德镇市| 临沂市| 湘潭市| 拉萨市| 三穗县| 潞城市| 大余县| 连云港市| 禹州市| 邵阳县| 通道| 江阴市| 城口县| 威远县| 太谷县| 洛南县| 定边县| 兴文县| 黄石市| 克东县| 滕州市| 南汇区| 柞水县| 南投县| 武宣县| 崇明县| 长宁区| 海伦市| 广汉市|