Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
envsetup
Manage
Activity
Members
Plan
Redmine
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mediaserver
envsetup
Commits
b82a8cee
Commit
b82a8cee
authored
8 years ago
by
Florent Thiery
Browse files
Options
Downloads
Patches
Plain Diff
simplify cache config by letting upstream define headers, refs
#20420
parent
91a6cc29
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
2.Common_services/5.Nginx/vhost_cache.conf
+12
-49
12 additions, 49 deletions
2.Common_services/5.Nginx/vhost_cache.conf
with
12 additions
and
49 deletions
2.Common_services/5.Nginx/vhost_cache.conf
+
12
−
49
View file @
b82a8cee
...
@@ -14,55 +14,18 @@ server {
...
@@ -14,55 +14,18 @@ server {
}
}
location
/
streaming
/ {
location
/
streaming
/ {
# Live
# Live; expiration headers are defined by upstream (nginx/wowza)
location
~ \.
m3u8
$ {
rewrite
^/(.*)$ /$
1
?
break
;
rewrite
^/(.*)$ /$
1
?
break
;
proxy_pass
{{
source_server
}};
proxy_pass
{{
source_server
}};
proxy_cache
uc
-
cache
;
proxy_cache
uc
-
cache
;
# do not consider secure urls as new files
# do not consider secure urls as new files
proxy_cache_key
$
scheme
$
proxy_host
$
uri
;
proxy_cache_key
$
scheme
$
proxy_host
$
uri
;
# only one request at a time will be allowed to populate a new cache element
# only one request at a time will be allowed to populate a new cache element
proxy_cache_lock
on
;
proxy_cache_lock
on
;
# hide upstream X-Cache header
# serve from cache while updating
proxy_hide_header
X
-
Cache
;
proxy_cache_use_stale
updating
;
# add own X-Cache header
# ignore upstream headers
add_header
X
-
Cache
$
upstream_cache_status
;
# http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_cache_valid
proxy_ignore_headers
"Cache-Control"
"X-Accel-Expires"
"Expires"
;
# hide upstream X-Cache header
proxy_hide_header
X
-
Cache
;
# add own X-Cache header
add_header
X
-
Cache
$
upstream_cache_status
;
# m3u8-specific
# how long should the data be kept in this cache
proxy_cache_valid
200
2
s
;
# instruct browsers never to cache m3u8
expires
-
1
;
}
location
~ \.
ts
$ {
rewrite
^/(.*)$ /$
1
?
break
;
proxy_pass
{{
source_server
}};
proxy_cache
uc
-
cache
;
# do not consider secure urls as new files
proxy_cache_key
$
scheme
$
proxy_host
$
uri
;
# only one request at a time will be allowed to populate a new cache element
proxy_cache_lock
on
;
# serve from cache while updating
proxy_cache_use_stale
updating
;
# ignore upstream headers
# http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_cache_valid
proxy_ignore_headers
"Cache-Control"
"X-Accel-Expires"
"Expires"
;
# hide upstream X-Cache header
proxy_hide_header
X
-
Cache
;
# add own X-Cache header
add_header
X
-
Cache
$
upstream_cache_status
;
# ts-specific
# how long should the data be kept in this cache
proxy_cache_valid
200
10
s
;
# instruct browsers to cache this for 6s
expires
6
s
;
}
}
}
location
/
resources
/ {
location
/
resources
/ {
# VOD
# VOD
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment