@@ -22,88 +22,95 @@ http {
22
22
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
23
23
'$status $body_bytes_sent "$http_referer" '
24
24
'"$http_user_agent" "$http_x_forwarded_for" "$request_time"';
25
-
25
+
26
26
access_log /var/log/nginx/access.log main;
27
27
error_log /var/log/nginx/error.log;
28
-
28
+
29
29
gzip on;
30
30
gzip_buffers 8 16k;
31
31
gzip_min_length 512;
32
32
gzip_disable "MSIE [1-6]\.(?!.*SV1)";
33
33
gzip_http_version 1.1;
34
34
gzip_types text/plain text/css application/javascript application/x-javascript application/json application/xml;
35
-
35
+
36
36
server {
37
-
37
+
38
38
listen 8001;
39
39
server_name localhost 127.0.0.1 139.159.190.24 platform.gitnavi.com;
40
-
40
+
41
41
location / {
42
42
root /root/.jenkins/workspace/nestle-platform-front-test/dist;
43
43
index index.html index.htm;
44
44
try_files $uri /index.html;
45
45
}
46
-
46
+
47
+ ## 二级目录方式,记得 package.json 添加:"homepage": "cdk8s-markdown",
48
+ location ^~ /cdk8s-markdown {
49
+ root /root/.jenkins/workspace;
50
+ index index.html;
51
+ try_files $uri /cdk8s-markdown/index.html;
52
+ }
53
+
47
54
location ^~ /platform/ {
48
55
proxy_pass http://127.0.0.1:28081;
49
56
proxy_redirect off;
50
57
proxy_set_header Host $host;
51
58
proxy_set_header X-Real-IP $remote_addr;
52
59
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
53
60
}
54
-
61
+
55
62
location ~ .*\.(js|css)?$ {
56
63
root /root/.jenkins/workspace/nestle-platform-front-test/dist;
57
64
}
58
-
65
+
59
66
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|ico|woff|woff2|ttf|eot|txt|svg)$ {
60
67
root /root/.jenkins/workspace/nestle-platform-front-test/dist;
61
68
}
62
-
69
+
63
70
error_page 404 /404.html;
64
71
location = /usr/share/nginx/html/40x.html {
65
72
}
66
-
73
+
67
74
error_page 500 502 503 504 /50x.html;
68
75
location = /usr/share/nginx/html/50x.html {
69
76
}
70
77
71
78
}
72
-
79
+
73
80
server {
74
-
81
+
75
82
listen 8002;
76
83
server_name localhost 127.0.0.1 139.159.190.24 store.gitnavi.com;
77
-
84
+
78
85
location / {
79
86
root /root/.jenkins/workspace/nestle-store-front-test/dist;
80
87
index index.html index.htm;
81
88
try_files $uri /index.html;
82
89
}
83
-
90
+
84
91
location ^~ /store/ {
85
92
proxy_pass http://127.0.0.1:28082;
86
93
proxy_redirect off;
87
94
proxy_set_header Host $host;
88
95
proxy_set_header X-Real-IP $remote_addr;
89
96
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
90
97
}
91
-
98
+
92
99
location ~ .*\.(js|css)?$ {
93
100
root /root/.jenkins/workspace/nestle-store-front-test/dist;
94
101
}
95
-
102
+
96
103
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|ico|woff|woff2|ttf|eot|txt|svg)$ {
97
104
root /root/.jenkins/workspace/nestle-store-front-test/dist;
98
105
}
99
-
106
+
100
107
error_page 404 /404.html;
101
108
location = /usr/share/nginx/html/40x.html {
102
109
}
103
-
110
+
104
111
error_page 500 502 503 504 /50x.html;
105
112
location = /usr/share/nginx/html/50x.html {
106
113
}
107
114
108
115
}
109
- }
116
+ }
0 commit comments