@@ -22,88 +22,95 @@ http {
2222 log_format main '$remote_addr - $remote_user [$time_local] "$request" '
2323 '$status $body_bytes_sent "$http_referer" '
2424 '"$http_user_agent" "$http_x_forwarded_for" "$request_time"';
25-
25+
2626 access_log /var/log/nginx/access.log main;
2727 error_log /var/log/nginx/error.log;
28-
28+
2929 gzip on;
3030 gzip_buffers 8 16k;
3131 gzip_min_length 512;
3232 gzip_disable "MSIE [1-6]\.(?!.*SV1)";
3333 gzip_http_version 1.1;
3434 gzip_types text/plain text/css application/javascript application/x-javascript application/json application/xml;
35-
35+
3636 server {
37-
37+
3838 listen 8001;
3939 server_name localhost 127.0.0.1 139.159.190.24 platform.gitnavi.com;
40-
40+
4141 location / {
4242 root /root/.jenkins/workspace/nestle-platform-front-test/dist;
4343 index index.html index.htm;
4444 try_files $uri /index.html;
4545 }
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+
4754 location ^~ /platform/ {
4855 proxy_pass http://127.0.0.1:28081;
4956 proxy_redirect off;
5057 proxy_set_header Host $host;
5158 proxy_set_header X-Real-IP $remote_addr;
5259 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
5360 }
54-
61+
5562 location ~ .*\.(js|css)?$ {
5663 root /root/.jenkins/workspace/nestle-platform-front-test/dist;
5764 }
58-
65+
5966 location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|ico|woff|woff2|ttf|eot|txt|svg)$ {
6067 root /root/.jenkins/workspace/nestle-platform-front-test/dist;
6168 }
62-
69+
6370 error_page 404 /404.html;
6471 location = /usr/share/nginx/html/40x.html {
6572 }
66-
73+
6774 error_page 500 502 503 504 /50x.html;
6875 location = /usr/share/nginx/html/50x.html {
6976 }
7077
7178 }
72-
79+
7380 server {
74-
81+
7582 listen 8002;
7683 server_name localhost 127.0.0.1 139.159.190.24 store.gitnavi.com;
77-
84+
7885 location / {
7986 root /root/.jenkins/workspace/nestle-store-front-test/dist;
8087 index index.html index.htm;
8188 try_files $uri /index.html;
8289 }
83-
90+
8491 location ^~ /store/ {
8592 proxy_pass http://127.0.0.1:28082;
8693 proxy_redirect off;
8794 proxy_set_header Host $host;
8895 proxy_set_header X-Real-IP $remote_addr;
8996 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
9097 }
91-
98+
9299 location ~ .*\.(js|css)?$ {
93100 root /root/.jenkins/workspace/nestle-store-front-test/dist;
94101 }
95-
102+
96103 location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|ico|woff|woff2|ttf|eot|txt|svg)$ {
97104 root /root/.jenkins/workspace/nestle-store-front-test/dist;
98105 }
99-
106+
100107 error_page 404 /404.html;
101108 location = /usr/share/nginx/html/40x.html {
102109 }
103-
110+
104111 error_page 500 502 503 504 /50x.html;
105112 location = /usr/share/nginx/html/50x.html {
106113 }
107114
108115 }
109- }
116+ }
0 commit comments