-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnginx.conf
51 lines (42 loc) · 1.97 KB
/
nginx.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
# 需要链接到/etc/nginx/conf.d/下
# 例:
# ln -s /root/workplace/cczu_second_hand_platform/nginx.conf /etc/nginx/conf.d/cczu_second_hand_platform_project.conf
# 部署时将注释路径切换下
server {
# listen 80;
listen 88;
server_name localhost cczu_second_hand_platform.com;
# access_log /root/workplace/cczu_second_hand_platform/logs/nginx_access.log;
access_log /home/lvpeng/workplace/django/cczu_second_hand_platform/logs/nginx_access.log;
# error_log /root/workplace/cczu_second_hand_platform/logs/nginx_error.log;
error_log /home/lvpeng/workplace/django/cczu_second_hand_platform/logs/nginx_error.log;
location / {
proxy_pass http://127.0.0.1:8080;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
client_max_body_size 100m;
}
location /robots.txt {
# alias /root/workplace/cczu_second_hand_platform/static/robots.txt;
alias /home/lvpeng/workplace/django/cczu_second_hand_platform/static/robots.txt;
}
location /favicon.ico {
# alias /root/workplace/cczu_second_hand_platform/static/second_hand_platform/images/favicon.ico;
alias /home/lvpeng/workplace/django/cczu_second_hand_platform/static/second_hand_platform/images/favicon.ico;
}
location ~ ^/(media|static)/ {
# root /root/workplace/cczu_second_hand_platform;
root /home/lvpeng/workplace/django/cczu_second_hand_platform;
expires 30d;
}
# this prevents hidden files (beginning with a period) from being served
location ~ /\. {
access_log off; log_not_found off; deny all;
}
error_page 502 /502.html;
location = /502.html {
# root /root/workplace/cczu_second_hand_platform/second_hand_platform/templates;
root /home/lvpeng/workplace/django/cczu_second_hand_platform/second_hand_platform/templates;
}
}