-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathnginx_ssl.conf
61 lines (52 loc) · 2.01 KB
/
nginx_ssl.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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# Please replace "yoursite.com" -> your domain
server {
listen 80;
server_name yoursite.com;
return 301 https://www.yoursite.com$request_uri;
}
server {
ssl on;
listen 443;
charset UTF-8;
server_name www.yoursite.com;
set $root_path '/home/yoursite/public';
root $root_path;
#access_log /var/log/nginx/yoursite.com-access.log;
#error_log /var/log/nginx/yoursite.com-error.log;
ssl_certificate /etc/ssl/cert_chain.crt;
ssl_certificate_key /etc/ssl/private/cert_private.key;
ssl_session_timeout 5m;
ssl_session_cache shared:SSL:10m;
ssl_ciphers "ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:DH$
ssl_prefer_server_ciphers on;
index index.php index.html index.htm;
location = /robots.txt { access_log off; log_not_found off; }
location ~ /\. { access_log off; log_not_found off; deny all; }
location ~ ~$ { access_log off; log_not_found off; deny all; }
location ~ /\.git { access_log off; log_not_found off; deny all; }
location ~ /\.ideal { access_log off; log_not_found off; deny all; }
location = /nginx_ssl.conf { access_log off; log_not_found off; deny all; }
location = /nginx_none_ssl.conf { access_log off; log_not_found off; deny all; }
location / {
try_files $uri $uri/ /index.php?$args;
}
location ~ \.php {
fastcgi_index /index.php;
fastcgi_pass 127.0.0.1:9001;
include fastcgi_params;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
location ~* ^/(css|img|js|flv|swf|xml|download)/(.+)$ {
root $root_path;
#d = day, w = week, m = month, y = year
expires 7d;
add_header Pragma public;
add_header Cache-Control "public";
}
location ~ /\.ht {
deny all;
}
}