Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
funkwhale
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nykopol
funkwhale
Commits
7205a8b2
Verified
Commit
7205a8b2
authored
Mar 29, 2018
by
Agate
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Development nginx container now work with customized port
parent
96d219df
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
17 deletions
+20
-17
deploy/funkwhale_proxy.conf
deploy/funkwhale_proxy.conf
+2
-2
dev.yml
dev.yml
+5
-0
docker/nginx/conf.dev
docker/nginx/conf.dev
+4
-15
docker/nginx/entrypoint.sh
docker/nginx/entrypoint.sh
+9
-0
No files found.
deploy/funkwhale_proxy.conf
View file @
7205a8b2
...
@@ -3,8 +3,8 @@ proxy_set_header Host $host;
...
@@ -3,8 +3,8 @@ proxy_set_header Host $host;
proxy_set_header
X
-
Real
-
IP
$
remote_addr
;
proxy_set_header
X
-
Real
-
IP
$
remote_addr
;
proxy_set_header
X
-
Forwarded
-
For
$
proxy_add_x_forwarded_for
;
proxy_set_header
X
-
Forwarded
-
For
$
proxy_add_x_forwarded_for
;
proxy_set_header
X
-
Forwarded
-
Proto
$
scheme
;
proxy_set_header
X
-
Forwarded
-
Proto
$
scheme
;
proxy_set_header
X
-
Forwarded
-
Host
$
host
:$
server_port
;
proxy_set_header
X
-
Forwarded
-
Host
$
host
:$
server_port
;
proxy_set_header
X
-
Forwarded
-
Port
$
server_port
;
proxy_set_header
X
-
Forwarded
-
Port
$
server_port
;
proxy_redirect
off
;
proxy_redirect
off
;
# websocket support
# websocket support
...
...
dev.yml
View file @
7205a8b2
...
@@ -72,15 +72,20 @@ services:
...
@@ -72,15 +72,20 @@ services:
-
redis
-
redis
nginx
:
nginx
:
command
:
/entrypoint.sh
env_file
:
env_file
:
-
.env.dev
-
.env.dev
-
.env
-
.env
image
:
nginx
image
:
nginx
environment
:
-
"
WEBPACK_DEVSERVER_PORT=${WEBPACK_DEVSERVER_PORT-8080}"
links
:
links
:
-
api
-
api
-
front
-
front
volumes
:
volumes
:
-
./docker/nginx/conf.dev:/etc/nginx/nginx.conf
-
./docker/nginx/conf.dev:/etc/nginx/nginx.conf
-
./docker/nginx/entrypoint.sh:/entrypoint.sh:ro
-
./deploy/funkwhale_proxy.conf:/etc/nginx/funkwhale_proxy.conf.template:ro
-
./api/funkwhale_api/media:/protected/media
-
./api/funkwhale_api/media:/protected/media
ports
:
ports
:
-
"
0.0.0.0:6001:6001"
-
"
0.0.0.0:6001:6001"
...
...
docker/nginx/conf.dev
View file @
7205a8b2
...
@@ -37,19 +37,7 @@ http {
...
@@ -37,19 +37,7 @@ http {
listen 6001;
listen 6001;
charset utf-8;
charset utf-8;
client_max_body_size 20M;
client_max_body_size 20M;
include /etc/nginx/funkwhale_proxy.conf;
# global proxy pass config
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 localhost:8080;
proxy_set_header X-Forwarded-Port 8080;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_redirect off;
location /_protected/media {
location /_protected/media {
internal;
internal;
alias /protected/media;
alias /protected/media;
...
@@ -63,8 +51,7 @@ http {
...
@@ -63,8 +51,7 @@ http {
if ($request_uri ~* "[^\?]+\?(.*)$") {
if ($request_uri ~* "[^\?]+\?(.*)$") {
set $query $1;
set $query $1;
}
}
proxy_set_header X-Forwarded-Host localhost:8080;
include /etc/nginx/funkwhale_proxy.conf;
proxy_set_header X-Forwarded-Port 8080;
proxy_pass http://api:12081/api/v1/trackfiles/viewable/?$query;
proxy_pass http://api:12081/api/v1/trackfiles/viewable/?$query;
proxy_pass_request_body off;
proxy_pass_request_body off;
proxy_set_header Content-Length "";
proxy_set_header Content-Length "";
...
@@ -78,6 +65,7 @@ http {
...
@@ -78,6 +65,7 @@ http {
if ($args ~ (.*)jwt=[^&]*(.*)) {
if ($args ~ (.*)jwt=[^&]*(.*)) {
set $cleaned_args $1$2;
set $cleaned_args $1$2;
}
}
include /etc/nginx/funkwhale_proxy.conf;
proxy_cache_key "$scheme$request_method$host$uri$is_args$cleaned_args";
proxy_cache_key "$scheme$request_method$host$uri$is_args$cleaned_args";
proxy_cache transcode;
proxy_cache transcode;
proxy_cache_valid 200 7d;
proxy_cache_valid 200 7d;
...
@@ -87,6 +75,7 @@ http {
...
@@ -87,6 +75,7 @@ http {
proxy_pass http://api:12081;
proxy_pass http://api:12081;
}
}
location / {
location / {
include /etc/nginx/funkwhale_proxy.conf;
proxy_pass http://api:12081/;
proxy_pass http://api:12081/;
}
}
}
}
...
...
docker/nginx/entrypoint.sh
0 → 100755
View file @
7205a8b2
#!/bin/bash -eux
echo
"Copying template file..."
cp
/etc/nginx/funkwhale_proxy.conf
{
.template,
}
sed
-i
"s/X-Forwarded-Host
\$
host:
\$
server_port/X-Forwarded-Host localhost:
${
WEBPACK_DEVSERVER_PORT
}
/"
/etc/nginx/funkwhale_proxy.conf
sed
-i
"s/proxy_set_header X-Forwarded-Port
\$
server_port/proxy_set_header X-Forwarded-Port
${
WEBPACK_DEVSERVER_PORT
}
/"
/etc/nginx/funkwhale_proxy.conf
cat
/etc/nginx/funkwhale_proxy.conf
nginx
-g
"daemon off;"
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment