Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
funkwhale
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
Zwordi
funkwhale
Commits
afb56503
Verified
Commit
afb56503
authored
7 years ago
by
Eliot Berriot
Browse files
Options
Downloads
Patches
Plain Diff
Updated example nginx deployment conf for transcoding
parent
a83328bc
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
deploy/nginx.conf
+45
-7
45 additions, 7 deletions
deploy/nginx.conf
with
45 additions
and
7 deletions
deploy/nginx.conf
+
45
−
7
View file @
afb56503
...
...
@@ -39,6 +39,15 @@ server {
root
/srv/funkwhale/front/dist
;
# global proxy conf
proxy_set_header
Host
$host
;
proxy_set_header
X-Real-IP
$remote_addr
;
proxy_set_header
X-Forwarded-For
$proxy_add_x_forwarded_for
;
proxy_set_header
X-Forwarded-Proto
$scheme
;
proxy_set_header
X-Forwarded-Host
$host
:
$server_port
;
proxy_set_header
X-Forwarded-Port
$server_port
;
proxy_redirect
off
;
location
/
{
try_files
$uri
$uri
/
@rewrites
;
}
...
...
@@ -49,15 +58,9 @@ server {
location
/api/
{
# this is needed if you have file import via upload enabled
client_max_body_size
30M
;
proxy_set_header
Host
$host
;
proxy_set_header
X-Real-IP
$remote_addr
;
proxy_set_header
X-Forwarded-For
$proxy_add_x_forwarded_for
;
proxy_set_header
X-Forwarded-Proto
$scheme
;
proxy_set_header
X-Forwarded-Host
$host
:
$server_port
;
proxy_set_header
X-Forwarded-Port
$server_port
;
proxy_redirect
off
;
proxy_pass
http://funkwhale-api/api/
;
}
location
/media/
{
alias
/srv/funkwhale/data/media/
;
}
...
...
@@ -70,6 +73,41 @@ server {
alias
/srv/funkwhale/data/media
;
}
# Transcoding logic and caching
location
=
/transcode-auth
{
# needed so we can authenticate transcode requests, but still
# cache the result
internal
;
set
$query
''
;
# ensure we actually pass the jwt to the underlytin auth url
if
(
$request_uri
~
*
"[^
\
?]+
\
?(.*)
$
")
{
set
$query
$1
;
}
proxy_set_header
X-Forwarded-Host
$host
:
$server_port
;
proxy_set_header
X-Forwarded-Port
$server_port
;
proxy_pass
http://api:12081/api/v1/trackfiles/viewable/?
$query
;
proxy_pass_request_body
off
;
proxy_set_header
Content-Length
""
;
}
location
/api/v1/trackfiles/transcode/
{
# this block deals with authenticating and caching transcoding
# requests. Caching is heavily recommended as transcoding
# is a CPU intensive process.
auth_request
/transcode-auth
;
if
(
$args
~
(.*)jwt=[^&]*(.*))
{
set
$cleaned_args
$1$2
;
}
proxy_cache_key
"
$scheme$request_method$host$uri$is_args$cleaned_args
"
;
proxy_cache
transcode
;
proxy_cache_valid
200
7d
;
proxy_ignore_headers
"Set-Cookie"
;
proxy_hide_header
"Set-Cookie"
;
add_header
X-Cache-Status
$upstream_cache_status
;
proxy_pass
http://funkwhale-api
;
}
# end of transcoding logic
location
/staticfiles/
{
# django static files
alias
/srv/funkwhale/data/static/
;
...
...
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