更新我的 NGINX 配置文件

最新版配置文件:My-NGINX-Config

不需要多创建两个虚拟机了。。。简洁多了,哈哈哈

2015,11,01,懒得管配置文件了。。。直接去我的

—>>> NGINX 配置文件仓库

sites/gehaowu.com.conf

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
server {
server_name gehaowu.com www.gehaowu.com;
include includes/listen_full.template;
include includes/header_add.template;
include includes/headers_set_more.template;
include sites/rewrite.gehaowu.com.template;
ssl_certificate keys/www.gehaowu.com.crt;
ssl_certificate_key keys/www.gehaowu.com.key;
ssl_trusted_certificate keys/startcom_ssl_trusted_certificate.crt;
ssl_dhparam keys/dhparam.pem;
ssl_ecdh_curve secp384r1;
include includes/ssl.template;
include includes/ssl_stapling.template;
set $rewriterule https;
if ($scheme = https) {
set $rewriterule "${rewriterule}1";
}
if ($host ~* ^www.) {
set $rewriterule "${rewriterule}2";
}
if ($rewriterule != "https12") {
return 301 https://www.gehaowu.com$request_uri;
}
include includes/block_files.template;
include includes/expires.template;
index index.html index.htm;
root /usr/home/wwwroot/www.gehaowu.com;
error_page 404 /404.html;
error_page 403 /403.html;
error_page 500 502 503 504 /50x.html;
access_log /usr/home/wwwroot/logs/gehaowu.com.access.log;
error_log /usr/home/wwwroot/logs/gehaowu.com.error.log;
}