|
|
@ -1,23 +1,29 @@
|
|
|
|
:8300, localhost {
|
|
|
|
(CORS) {
|
|
|
|
|
|
|
|
@origin header Origin {args.0}
|
|
|
|
|
|
|
|
header @origin Access-Control-Allow-Origin "{args.0}"
|
|
|
|
|
|
|
|
header @origin Access-Control-Allow-Methods "OPTIONS,HEAD,GET,POST,PUT,PATCH,DELETE"
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
root * /data/dist
|
|
|
|
:8300 {
|
|
|
|
# Vue Router history模式,避免刷新后404页面;字符中间不可有空格
|
|
|
|
encode zstd gzip
|
|
|
|
try_files {path} /index.html
|
|
|
|
|
|
|
|
handle_path /stage-api/* {
|
|
|
|
handle_path /stage-api/* {
|
|
|
|
|
|
|
|
import CORS
|
|
|
|
uri strip_prefix /stage-api
|
|
|
|
uri strip_prefix /stage-api
|
|
|
|
# 需要代理到的IP以及端口号
|
|
|
|
# 需要代理到的IP以及端口号
|
|
|
|
reverse_proxy ruoyi-admin:8080
|
|
|
|
reverse_proxy ruoyi-admin:8080
|
|
|
|
}
|
|
|
|
}
|
|
|
|
file_server
|
|
|
|
handle {
|
|
|
|
encode zstd gzip
|
|
|
|
root * /data/dist
|
|
|
|
# CORS
|
|
|
|
# Vue Router history模式,避免刷新后404页面;字符中间不可有空格
|
|
|
|
import CORS
|
|
|
|
try_files {path}.html {path} /index.html
|
|
|
|
}
|
|
|
|
file_server
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
log {
|
|
|
|
|
|
|
|
format formatted "[{ts}] {request>remote_addr} {request>proto} {request>method} <- {status} -> {request>host} {request>uri} {request>headers>User-Agent>[0]}" {
|
|
|
|
|
|
|
|
time_format "iso8601"
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
output file "/dev/stdout"
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
(CORS) {
|
|
|
|
|
|
|
|
header replace Access-Control-Allow-Origin "*"
|
|
|
|
|
|
|
|
header replace Access-Control-Allow-Headers "*"
|
|
|
|
|
|
|
|
header replace Access-Control-Allow-Methods "*"
|
|
|
|
|
|
|
|
header replace Access-Control-Request-Method "POST, GET, OPTIONS"
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|