Nginx Configuration Virtual Host under Window Phpstudy

Source: Internet
Author: User

Because of a long time did not configure Apache, although said know how to configure Nginx, but it took some time to write down the next time directly with

On the other options File menu, open configuration file, select Vhosts-conf

Nginx words use

server {        listen       ;        server_name  the name of your virtual directory;        Root   "directory path you want to manipulate";        Location/{            index  index.html index.htm index.php;            #autoindex on  ;            if ($request _filename!~ (static|robots/.txt|index/.php.*)) {                rewrite ^/(. *) $/index.php?$1 last;                break;                }        }        Location ~ \.php (. *) $ {            fastcgi_pass   127.0.0.1:9000;            Fastcgi_index  index.php;            Fastcgi_split_path_info  ^ (? U). +\.php) (/?. +)$;            Fastcgi_param  script_filename  $document _root$fastcgi_script_name;            Fastcgi_param  path_info  $fastcgi _path_info;            Fastcgi_param  path_translated  $document _root$fastcgi_path_info;            Include        fastcgi_params;        }}

The most important thing after that is DNS resolution: Open the hosts under C:\WINDOWS\SYSTEM32\DRIVERS\ETC

Add the domain name that you configured to resolve to local code such as

127.0.0.1       localhost                               This is the default 127.0.0.1       www.mycomment.com

Apache Virtual host code can refer to the

<virtualhost *:80>serveradmin [Email protected]documentroot "F:\WORKSPACE\VIM\YNOTE\SRC"    ServerName editor.fuyg.cn    serveralias editor.fuyg.cn    errorlog "Logs/dummy-host.localhost-error.log"    customlog " Logs/dummy-host.localhost-access.log "combined    <directory" F:\WORKSPACE\VIM\YNOTE\SRC ">        options Indexes followsymlinks        allowoverride all         Order allow,deny to    </Directory>< /virtualhost>

Nginx Configuration Virtual Host under Window Phpstudy

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.