Nginx configuration Summary

Source: Internet
Author: User

Nginx. conf:

HTTP {

Include mime. types;

Default_type application/octet-stream;


# Log_format main '$ remote_addr-$ remote_user [$ time_local] "$ request "'

# '$ Status $ body_bytes_sent "$ http_referer "'

# '"$ Http_user_agent" "$ http_x_forwarded_for "';


# Access_log logs/access. Log main;


Sendfile on;

# Tcp_nopush on;


# Keepalive_timeout 0;

Keepalive_timeout 65;

Client_max_body_size 10 m;


# Gzip on;


# The domain name address is used before the configuration order is loaded

# Include D:/wnmp/nginx-1.4.3/CONF/vhost/test. conf;

# Include D:/wnmp/nginx-1.4.3/CONF/vhost/CI. conf;

Include D:/wnmp/nginx-1.4.3/CONF/vhost/*. conf;

}

A server configuration in the vhost folder

Server {

Listen 80;

SERVER_NAME tczsslocal.com;


Location /{

Root D:/wnmp/tczsslocal;

Index index. php index.html index.htm;

If (-d $ request_filename ){

Rewrite ^/(. *) ([^/]) $ http: // $ host/$1 $2/permanent;

}

If (! -E $ request_filename ){

Rewrite ^ /(.*)/? V = $1 break;

}


}


Error_page 500 502 503 x.html;

Location =/50x.html {

Root HTML;

}


Location ~ \. Php $ {

Root D:/wnmp/tczsslocal;

Fastcgi_pass 127.0.0.1: 9000;

Fastcgi_index index. php;

Fastcgi_param script_filename D:/wnmp/tczsslocal $ fastcgi_script_name;

Include fastcgi_params;

Include D:/wnmp/nginx-1.4.3/CONF/FastCGI. conf;

}


}


Nginx configuration Summary

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.