Skip to content

Commit 588b48e

Browse files
committed
chore: enhance nginx config
1 parent c97b867 commit 588b48e

File tree

3 files changed

+36
-0
lines changed

3 files changed

+36
-0
lines changed

Diff for: .dockerignore

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.*/*
2+
node_modules/
3+
log/
4+
*.log
5+
temp
6+
output
7+
dist

Diff for: Dockerfile.storybook

+1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
FROM nginx:alpine
2+
COPY storybook.nginx.conf /etc/nginx/nginx.conf
23
COPY storybook-static /usr/share/nginx/html/bao-storybook

Diff for: storybook.nginx.conf

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
events {
2+
worker_connections 1024;
3+
}
4+
http {
5+
include mime.types;
6+
sendfile on;
7+
tcp_nopush on;
8+
keepalive_timeout 5s;
9+
gzip on;
10+
gzip_comp_level 4;
11+
gzip_types text/css;
12+
gzip_types text/javascript;
13+
root /usr/share/nginx/html/;
14+
15+
map $http_x_forwarded_proto $forwarded_proto {
16+
default "http";
17+
https "https";
18+
}
19+
20+
server {
21+
listen 80;
22+
23+
rewrite ^([^.?]*[^/?])([?].*)?$ $forwarded_proto://$host$1/$2 permanent;
24+
25+
location / {
26+
}
27+
}
28+
}

0 commit comments

Comments
 (0)