Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Sunny_yiyi
Swagger Ui
提交
dd34393e
S
Swagger Ui
项目概览
Sunny_yiyi
/
Swagger Ui
通知
4
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
Swagger Ui
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
dd34393e
编写于
2月 02, 2019
作者:
S
Segev Finer
提交者:
kyle
2月 02, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
improvement(docker): avoid caching mounted json/yml/yaml assets (via #5151)
上级
455ec3d3
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
27 addition
and
26 deletion
+27
-26
Dockerfile
Dockerfile
+1
-1
docker/cors.conf
docker/cors.conf
+14
-0
docker/nginx.conf
docker/nginx.conf
+11
-24
docker/run.sh
docker/run.sh
+1
-1
未找到文件。
Dockerfile
浏览文件 @
dd34393e
...
...
@@ -13,7 +13,7 @@ ENV SWAGGER_JSON "/app/swagger.json"
ENV
PORT 8080
ENV
BASE_URL ""
COPY
./docker/nginx.conf /etc/nginx/
COPY
./docker/nginx.conf
./docker/cors.conf
/etc/nginx/
# copy swagger files to the `/js` folder
COPY
./dist/* /usr/share/nginx/html/
...
...
docker/cors.conf
0 → 100644
浏览文件 @
dd34393e
add_header
'Access-Control-Allow-Origin'
'*'
always
;
add_header
'Access-Control-Allow-Methods'
'GET, POST, OPTIONS'
always
;
#
# Custom headers and headers various browsers *should* be OK with but aren't
#
add_header
'Access-Control-Allow-Headers'
'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type'
always
;
#
# Tell client that this pre-flight info is valid for 20 days
#
add_header
'Access-Control-Max-Age'
$
access_control_max_age
always
;
if
($
request_method
=
OPTIONS
) {
return
204
;
}
docker/nginx.conf
浏览文件 @
dd34393e
...
...
@@ -12,6 +12,10 @@ http {
keepalive_timeout
65
;
map
$request_method
$access_control_max_age
{
OPTIONS
1728000
;
# 20 days
}
server
{
listen
8080
;
server_name
localhost
;
...
...
@@ -19,32 +23,15 @@ http {
location
/
{
alias
/usr/share/nginx/html/
;
expires
1d
;
if
(
$request_method
=
'OPTIONS')
{
add_header
'Access-Control-Allow-Origin'
'*'
;
add_header
'Access-Control-Allow-Methods'
'GET,
POST,
OPTIONS'
;
#
# Custom headers and headers various browsers *should* be OK with but aren't
#
add_header
'Access-Control-Allow-Headers'
'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type'
;
#
# Tell client that this pre-flight info is valid for 20 days
#
add_header
'Access-Control-Max-Age'
1728000
;
add_header
'Content-Type'
'text/plain
charset=UTF-8'
;
add_header
'Content-Length'
0
;
return
204
;
}
if
(
$request_method
=
'POST')
{
add_header
'Access-Control-Allow-Origin'
'*'
;
add_header
'Access-Control-Allow-Methods'
'GET,
POST,
OPTIONS'
;
add_header
'Access-Control-Allow-Headers'
'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type'
;
}
if
(
$request_method
=
'GET')
{
add_header
'Access-Control-Allow-Origin'
'*'
;
add_header
'Access-Control-Allow-Methods'
'GET,
POST,
OPTIONS'
;
add_header
'Access-Control-Allow-Headers'
'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type'
;
location
~
*
\
.(?:json|yml|yaml)
$
{
expires
-1
;
include
cors.conf
;
}
include
cors.conf
;
}
}
}
docker/run.sh
浏览文件 @
dd34393e
...
...
@@ -24,7 +24,7 @@ replace_or_delete_in_index () {
}
if
[
"
${
BASE_URL
}
"
]
;
then
sed
-i
"s|location
.*
{|location
$BASE_URL
{|g"
/etc/nginx/nginx.conf
sed
-i
"s|location
/
{|location
$BASE_URL
{|g"
/etc/nginx/nginx.conf
fi
replace_in_index myApiKeyXXXX123456789
$API_KEY
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录