nginxconf Configuration Instructions

Source: Internet
Author: User
The contents of the 1:nginx.conf file are as follows:

Worker_processes 4; Refers to a 4-core CPU

Events {
Worker_connections 65535; Linux under ulimit-n view parameter matching
}


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";

Sendfile on;//Transfer File acceleration
Keepalive_timeout 30;//Visit website wait time

Client_max_body_size 6m;//max upload file size

Gzip on;//text File compression transfer

include/opt/nginx/conf/vhost/*;//includes multiple configured Web sites, for example: B2b.conf and auto.conf
}

The contents of the 2:b2b.conf file are as follows:

server {
Listen 80;
server_name www.b2bxxx.cn b2bxxx.cn;

Location/{//homepage
Root/opt/huahuionline;
Index index.html index.htm;
}

Location ^~/static/{//static file
root/opt;
}

Location ~. *$ {
Proxy_pass http://127.0.0.1:22; Dynamic program Jump
}

Location ~. *\. (Gif|jpg|jpeg|png|bmp|swf|mp4) $ {
Expires 60d;//cache for 60 days
}

Location ~. *\. (JS|CSS)? $ {
Expires 3h;//cache for 3 hours
}
Location ~. *\. (HTML)? $ {
Expires 5m;//cache for 5 minutes
}

Access_log/opt/nginx/logs/b2b.log; Default Access.log
error_log/opt/nginx/logs/b2b_err.log;//default Error.log
}

3:auto.conf content is as follows:

server {
Listen 80;
server_name Www.autodesign.club Autodesign.club;

Location ^~/auto_static/{
root/opt;
}

Location ~. *$ {
Proxy_pass http://127.0.0.1:33; The port is not the same as above
Rewrite ^/$/mainctrl?page=indexpage last; Home Jump
}

Location ~. *\. (Gif|jpg|jpeg|png|bmp|swf|mp4) $ {
Expires 60d;
}

Location ~. *\. (JS|CSS)? $ {
Expires 3h;
}

Access_log/opt/nginx/logs/auto.log;
Error_log/opt/nginx/logs/auto_err.log;

}

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

The above describes the nginxconf configuration instructions, 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.