ini 示例Nginx Laravel服务器块

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ini 示例Nginx Laravel服务器块相关的知识,希望对你有一定的参考价值。

1. `mkdir /var/www/laravel`
2. `vim /etc/nginx/sites-available/default` #replace default with https://gist.github.com/dikaio/601ec9b09b5a282db8b78ab89f1ad92b
3. `vim /etc/php/7.0/fpm/php.ini` #change cgi.fix_pathinfo=1 with 0=
4. `vim /etc/php/7.0/fpm/pool.d/www.conf` #change line, `listen = 127.0.0.1:9000` to `listen = /run/php/php7.0-fpm.sock`
5. sudo service php7.0-fpm restart && sudo service nginx restart
6. curl -sS https://getcomposer.org/installer | php
7. mv composer.phar /usr/local/bin/composer
8. composer create-project laravel/laravel /var/www/laravel/ 4.2
9. chgrp -R www-data /var/www/laravel && chmod -R 775 /var/www/laravel/app/storage
server {
        listen 80 default_server;
        root /var/www/laravel/public;
        index index.php index.html index.htm;
        server_name _;
        location / {
                try_files $uri $uri/ /index.php$is_args$args;
        }
        location ~ \.php$ {
                try_files $uri /index.php = 404;
                fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
                fastcgi_index index.php;
                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                include fastcgi_params;
        }
}

以上是关于ini 示例Nginx Laravel服务器块的主要内容,如果未能解决你的问题,请参考以下文章

ini nginx_laravel.conf

ini nginx virtualhost laravel

ini laravel nginx虚拟主机配置

ini Laravel Nginx配置

ini 使用nginx缓存并响应Web请求#nginx #php #performance #laravel

ini Nginx位置块特定文件#nginx