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
f3e1446a
Commit
f3e1446a
authored
8 years ago
by
Florent Thiery
Browse files
Options
Downloads
Patches
Plain Diff
fixup indentation (spaces), restore use stale
parent
773b0736
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
+79
-77
79 additions, 77 deletions
2.Common_services/5.Nginx/vhost_cache.conf
with
79 additions
and
77 deletions
2.Common_services/5.Nginx/vhost_cache.conf
+
79
−
77
View file @
f3e1446a
proxy_cache_path
/
tmp
/
nginx
-
uc
-
cache
levels
=
1
:
2
keys_zone
=
uc
-
cache
:
10
m
max_size
=
10
g
inactive
=
300
s
;
server
{
listen
80
default_server
;
listen
443
default_server
ssl
;
server_name
{{
server_name
}};
listen
80
default_server
;
listen
443
default_server
ssl
;
server_name
{{
server_name
}};
root
/
var
/
www
/
cache
/;
root
/
var
/
www
/
cache
/;
access_log
/
var
/
log
/
nginx
/
access_cache
.
log
;
error_log
/
var
/
log
/
nginx
/
error_cache
.
log
;
access_log
/
var
/
log
/
nginx
/
access_cache
.
log
;
error_log
/
var
/
log
/
nginx
/
error_cache
.
log
;
location
/
crossdomain
{
}
location
/
crossdomain
{
}
location
/
streaming
/ {
# Live
location
~ \.
m3u8
$ {
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
;
# ignore upstream headers
location
/
streaming
/ {
# Live
location
~ \.
m3u8
$ {
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
;
proxy_ignore_headers
X
-
Accel
-
Expires
;
proxy_ignore_headers
Expires
;
proxy_ignore_headers
"Cache-Control"
"X-Accel-Expires"
"Expires"
;
# hide upstream X-Cache header
proxy_hide_header
X
-
Cache
;
proxy_hide_header
X
-
Cache
;
# add own X-Cache header
add_header
X
-
Cache
$
upstream_cache_status
;
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
;
# ignore upstream headers
# how long should the data be kept in this cache
proxy_cache_valid
200
2
s
;
# instruct browsers never to cache m3u8 max 1s
expires
1
s
;
}
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
;
proxy_ignore_headers
X
-
Accel
-
Expires
;
proxy_ignore_headers
Expires
;
proxy_ignore_headers
Cache
-
Control
;
proxy_ignore_headers
X
-
Accel
-
Expires
;
proxy_ignore_headers
Expires
;
# hide upstream X-Cache header
proxy_hide_header
X
-
Cache
;
proxy_hide_header
X
-
Cache
;
# add own X-Cache header
add_header
X
-
Cache
$
upstream_cache_status
;
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
/ {
# VOD
location
~ \.(
m3u8
|
ts
|
mp4
|
mp3
|
oga
|
ogv
|
ogg
|
mov
|
flv
)$ {
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
;
proxy_cache_min_uses
1
;
proxy_cache_use_stale
updating
;
# how long should the data be kept in the cache
proxy_cache_valid
200
7
d
;
# instruct browser to cache this
expires
7
d
;
# headers
proxy_ignore_headers
Cache
-
Control
;
proxy_ignore_headers
Set
-
Cookie
;
proxy_ignore_headers
X
-
Accel
-
Expires
;
proxy_ignore_headers
Expires
;
add_header
X
-
Cache
$
upstream_cache_status
;
}
}
location
/ {
# only urls to video and audio files are allowed, discard any requested path for other urls
rewrite
^/(.*)$ /
index
.
html
?
break
;
}
# 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
/ {
# VOD
location
~ \.(
m3u8
|
ts
|
mp4
|
mp3
|
oga
|
ogv
|
ogg
|
mov
|
flv
)$ {
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
;
proxy_cache_min_uses
1
;
proxy_cache_use_stale
updating
;
# how long should the data be kept in the cache
proxy_cache_valid
200
7
d
;
# instruct browser to cache this
expires
7
d
;
# headers
proxy_ignore_headers
Cache
-
Control
;
proxy_ignore_headers
Set
-
Cookie
;
proxy_ignore_headers
X
-
Accel
-
Expires
;
proxy_ignore_headers
Expires
;
add_header
X
-
Cache
$
upstream_cache_status
;
}
}
location
/ {
# only urls to video and audio files are allowed, discard any requested path for other urls
rewrite
^/(.*)$ /
index
.
html
?
break
;
}
}
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