Nginx Configuration Virtual Host (php Supported)

Source: Internet
Author: User

Configuration Steps:

1, in the Nginx installation directory, find nginx.conf folder, new Vhost folder

2. Add the include vhost/*.conf at the end of nginx.conf http{};

3. Enter the file you created in the first step, and create the desired configuration file kt.conf

4. Edit kt.conf Add the following content

Server {listen80; server_name www. Kt.hd; Root C:/www/kt/; Index index. PHP index.html Index.htm; location/{try_files$uri $uri//index.php$is _args$args;#Remove index.php in frame} location~ \.php$ {fastcgi_pass127.0.0.1:9000; #Fastcgi_pass unix:/run/php/php7.0-fpm.sock;Fastcgi_split_path_info ^ (. +\.php) (. *)$; Fastcgi_split_path_info^ (. +\.php) (/.+)\$; Fastcgi_index Index.php; Fastcgi_param Script_filename$document _root$fastcgi_script_name; includefastcgi_params; }}

5. Restart Nginx

Nginx Configuration Virtual Host (php Supported)

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.