-
-
Notifications
You must be signed in to change notification settings - Fork 685
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(gateway): add oss conf in gateway;
- Loading branch information
Showing
2 changed files
with
38 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
lua_shared_dict domain_cache 128m; | ||
proxy_cache_path /tmp/cache levels=1:2 keys_zone=file_cache:10m max_size=10g inactive=60m; | ||
|
||
server { | ||
listen 80; | ||
server_name ${DEPLOY_OSS_DOMAIN}; | ||
client_max_body_size 0; | ||
|
||
gzip on; | ||
gzip_min_length 10k; | ||
gzip_comp_level 1; | ||
gzip_vary on; | ||
gzip_types text/plain application/javascript application/x-javascript text/css application/xml text/javascript application/json font/ttf font/otf image/svg+xml; | ||
|
||
location / { | ||
# Allow CORS | ||
add_header Access-Control-Allow-Origin * always; | ||
add_header Access-Control-Allow-Methods GET,POST,PUT,DELETE,PATCH,OPTIONS always; | ||
add_header Access-Control-Allow-Headers * always; | ||
add_header Access-Control-Expose-Headers * always; | ||
add_header Access-Control-Max-Age 3600 always; | ||
|
||
if ($request_method = 'OPTIONS') { | ||
return 204; | ||
} | ||
|
||
# resolve oss service | ||
resolver 127.0.0.11; | ||
|
||
# proxy | ||
proxy_pass http://oss:9000/; | ||
proxy_read_timeout 600s; | ||
proxy_set_header Host $http_host; | ||
proxy_set_header X-Real-IP $remote_addr; | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
} | ||
} |