阿里云服务器nginx配置
server {
listen 80;
server_name localhost;
root /;
# server_name www.yanyou.club;
#charset koi8-r;
#access_log logs/host.access.log main;
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
location / {
if ($request_uri ~* '/fr/@bianpengfei-utils') {
rewrite (.*)$ /fr/@bianpengfei-utils/v2 last;
}
}
location = /haha {
root /usr;
rewrite ^.*$ /index.html break;
}
location ^~ /fr/react-cli {
root /front/projects/;
try_files $uri $uri/ /fr/react-cli/index.html;
}
location ^~ /fr/pc-template {
# alias /front/projects/fr/pc-template/;
#try_files $uri $uri/ /front/projects/fr/pc-template/index.html;
root /front/projects;
try_files $uri $uri/ /fr/pc-template/index.html;
index index.html index.htm;
if ($request_filename ~* .*\.(?:htm|html)) {
add_header Cache-Control "private, no-store, no-cache, must-revalidate, proxy-revalidate";
}
}
# location @router {
# rewrite ^.*$ /fr/ceshi/$1 last;
# }
location ^~ /fr/pc-template-vite {
root /front/projects/;
try_files $uri $uri/ fr/pc-template-vite/index.html;
if ($request_filename ~* .*\.(?:htm|html)) {
add_header Cache-Control "private, no-store, no-cache, must-revalidate, proxy-revalidate";
}
}
location ^~ /fr/pc-template-clone {
root /front/projects/;
try_files $uri $uri/ /fr/pc-template-clone/index.html;
if ($request_filename ~* .*\.(?:htm|html)) {
add_header Cache-Control "private, no-store, no-cache, must-revalidate, proxy-revalidate";
}
}
location ^~ /fr/h5-template {
root /front/projects/;
try_files $uri $uri/ /fr/h5-template/index.html;
if ($request_filename ~* .*\.(?:htm|html)) {
add_header Cache-Control "private, no-store, no-cache, must-revalidate, proxy-revalidate";
}
}
location ^~ /fr/@bianpengfei-utils/v1 {
root /front/projects/;
try_files $uri $uri/ /fr/@bianpengfei-utils/v1/index.html;
if ($request_filename ~* .*\.(?:htm|html)) {
add_header Cache-Control "private, no-store, no-cache, must-revalidate, proxy-revalidate";
}
}
location ^~ /fr/@bianpengfei-utils/v2 {
root /front/projects/;
try_files $uri $uri/ /fr/@bianpengfei-utils/v2/index.html;
if ($request_filename ~* .*\.(?:htm|html)) {
add_header Cache-Control "private, no-store, no-cache, must-revalidate, proxy-revalidate";
}
}
location ^~ /fr/learn-webpack5-docs/ {
root /front/projects;
try_files $uri $uri/ /fr/learn-webpack5-docs/index.html;
if ($request_filename ~* .*\.(?:htm|html)) {
add_header Cache-Control "private, no-store, no-cache, must-revalidate, proxy-revalidate";
}
}
location /fee_domain_prefix {
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header REMOTE-HOST $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://221.181.195.12:80;
rewrite ^/fee_domain_prefix/(.*)$ /$1 break;
}
location ^~ /fr/mandalat-ui/ {
root /front/projects/;
try_files $uri $uri/ /fr/mandalat-ui/index.html;
}
location ^~ /static/tinymce {
alias /front/static/tinymce/;
}
location ^~ /fr/static/ {
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow-Credentials' 'true';
if ($request_method = OPTIONS) {
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow-Credentials' 'true';
add_header 'Access-Control-Max-Age' 1728000;
add_header 'Access-Control-Allow-Credentials' 'true';
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS, DELETE';
add_header 'Access-Control-Allow-Headers' 'reqid, nid, host, x-real-ip, x-forwarded-ip, event-type, event-id, accept, content-type';
return 200;
}
alias /front/static/;
}
location ~ /fr/test {
root /static;
try_files $uri $uri/ /fr/test/index.html;
}
}
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
上次更新: 2022/12/30, 23:48:21