YII/YII2/NGINX/PHP-FPM configuration instance on CentOS6 system

Source: Internet
Author: User
Tags yii
YII application Apache configuration is relatively simple, nginx configuration mainly need to deal with a single entry file, which corresponds to the Apache configuration in the following sentence:

# If a directory or a file exists, use it directlyrewritecond%{request_filename}!-frewritecond%{request_filename}!-d# Otherwise forward it to index.phprewriterule. index.php
Need to translate to the corresponding nginx instructions. Examples are as follows:

server {    listen;    server_name www.techbrood.com;    Access_log Logs/techbrood.access.log;    Root/var/www/html/techbrood/web;    Location/{        index index.php;        if (!-e $request _filename) {          rewrite ^/(. *)/index.php last;        }    }    Location ~ \.php (? | $) {        #fastcgi (PHP-FPM) listening on 127.0.0.1:9000        root/var/www/html/techbrood/web;        #your path to fastcgi_params file        include/etc/nginx/conf/fastcgi_params;         Fastcgi_index index.php;        Fastcgi_param script_filename $document _root$fastcgi_script_name;        Fastcgi_pass 127.0.0.1:9000;        #fastcgi_pass Unix:/var/run/php-fpm.sock    } location    ~ \. ( Jpg|jpeg|gif|css|png|js|ico|html|xml|txt) $ {        root/var/www/html/techbrood/web;    }}

by Iefreer

The above describes the CENTOS6 system on the YII/YII2/NGINX/PHP-FPM configuration examples, including the aspects of the content, I hope that the PHP tutorial interested in a friend helpful.

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.