forked from Ehco1996/django-sspanel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnginx_vhost_https.conf
43 lines (33 loc) · 1.19 KB
/
nginx_vhost_https.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
server
{
server_name you.domain.com;
listen 80;
#添加如下内容即可防止爬虫
if ($http_user_agent ~* "qihoobot|Baiduspider|Googlebot|Googlebot-Mobile|Googlebot-Image|Mediapartners-Google|Adsbot-Google|Feedfetcher-Google|Yahoo! Slurp|Yahoo! Slurp China|YoudaoBot|Sosospider|Sogou spider|Sogou web spider|MSNBot|ia_archiver|Tomato Bot")
{
return 403;
}
location /media {
alias /home/www/django-sspanel/media; # your Django project's media files - amend as required
}
location /static
{
alias /home/www/django-sspanel/static; #静态文件地址,js/css
expires 12h;
}
location /
{
include uwsgi_params;
uwsgi_pass 127.0.0.1:8080;
}
}
server
{
server_name www.ehcozone.ml;
listen 443 ssl;
ssl on;
# https 证书的支持
ssl_certificate /etc/letsencrypt/live/you.domain.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/you.domain.com/privkey.pem;
ssl_trusted_certificate /etc/letsencrypt/you.domain.com/chain.pem;
}