fix(nginx): Fix docker nginx configurations
This commit is contained in:
parent
eb0c644b93
commit
6157df5552
|
@ -1,7 +1,6 @@
|
||||||
|
|
||||||
upstream funkwhale-api {
|
upstream funkwhale-api {
|
||||||
# depending on your setup, you may want to update this
|
# depending on your setup, you may want to update this
|
||||||
server ${FUNKWHALE_API_IP}:${FUNKWHALE_API_PORT};
|
server ${FUNKWHALE_API_HOST}:${FUNKWHALE_API_PORT};
|
||||||
}
|
}
|
||||||
|
|
||||||
upstream funkwhale-front {
|
upstream funkwhale-front {
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
|
|
||||||
upstream funkwhale-api {
|
upstream funkwhale-api {
|
||||||
# depending on your setup, you may want to update this
|
# depending on your setup, you may want to update this
|
||||||
server ${FUNKWHALE_API_IP}:${FUNKWHALE_API_PORT};
|
server ${FUNKWHALE_API_HOST}:${FUNKWHALE_API_PORT};
|
||||||
}
|
}
|
||||||
|
|
||||||
# Required for websocket support.
|
# Required for websocket support.
|
||||||
|
|
|
@ -3,12 +3,19 @@ upstream fw {
|
||||||
server ${FUNKWHALE_API_IP}:${FUNKWHALE_API_PORT};
|
server ${FUNKWHALE_API_IP}:${FUNKWHALE_API_PORT};
|
||||||
}
|
}
|
||||||
{% else %}
|
{% else %}
|
||||||
|
{% if config.inside_docker %}
|
||||||
|
upstream funkwhale-api {
|
||||||
|
# depending on your setup, you may want to update this
|
||||||
|
server ${FUNKWHALE_API_HOST}:${FUNKWHALE_API_PORT};
|
||||||
|
}
|
||||||
|
{% else %}
|
||||||
|
|
||||||
upstream funkwhale-api {
|
upstream funkwhale-api {
|
||||||
# depending on your setup, you may want to update this
|
# depending on your setup, you may want to update this
|
||||||
server ${FUNKWHALE_API_IP}:${FUNKWHALE_API_PORT};
|
server ${FUNKWHALE_API_IP}:${FUNKWHALE_API_PORT};
|
||||||
}
|
}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% endif %}
|
||||||
{% if config.proxy_frontend %}
|
{% if config.proxy_frontend %}
|
||||||
|
|
||||||
upstream funkwhale-front {
|
upstream funkwhale-front {
|
||||||
|
@ -68,7 +75,7 @@ server {
|
||||||
listen [::]:80;
|
listen [::]:80;
|
||||||
|
|
||||||
server_name _;
|
server_name _;
|
||||||
|
PI_IP}:${FUNKWHALE_API_PORT};
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
# General configs
|
# General configs
|
||||||
|
@ -76,7 +83,7 @@ server {
|
||||||
{% if config.inside_docker %}
|
{% if config.inside_docker %}
|
||||||
root /usr/share/nginx/html;
|
root /usr/share/nginx/html;
|
||||||
{% else %}
|
{% else %}
|
||||||
root ${FUNKWHALE_FRONTEND_PATH},
|
root ${FUNKWHALE_FRONTEND_PATH};
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
client_max_body_size ${NGINX_MAX_BODY_SIZE};
|
client_max_body_size ${NGINX_MAX_BODY_SIZE};
|
||||||
|
@ -130,12 +137,12 @@ server {
|
||||||
{% if config.proxy_frontend and not config.reverse_proxy %}
|
{% if config.proxy_frontend and not config.reverse_proxy %}
|
||||||
proxy_pass http://funkwhale-front;
|
proxy_pass http://funkwhale-front;
|
||||||
{% elif not config.proxy_frontend and config.reverse_proxy %}
|
{% elif not config.proxy_frontend and config.reverse_proxy %}
|
||||||
proxy_pass http://fw
|
proxy_pass http://fw;
|
||||||
{% else %}
|
{% else %}
|
||||||
{% if config.inside_docker %}
|
{% if config.inside_docker %}
|
||||||
alias /usr/share/nginx/html/;
|
alias /usr/share/nginx/html/;
|
||||||
{% else %}
|
{% else %}
|
||||||
alias ${FUNKWHALE_FRONTEND_PATH}/,
|
alias ${FUNKWHALE_FRONTEND_PATH}/;
|
||||||
{% endif %}
|
{% endif %}
|
||||||
try_files $uri $uri/ /index.html;
|
try_files $uri $uri/ /index.html;
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
@ -150,7 +157,7 @@ server {
|
||||||
{% if config.inside_docker %}
|
{% if config.inside_docker %}
|
||||||
alias /usr/share/nginx/html/embed.html;
|
alias /usr/share/nginx/html/embed.html;
|
||||||
{% else %}
|
{% else %}
|
||||||
alias ${FUNKWHALE_FRONTEND_PATH}/embed.html,
|
alias ${FUNKWHALE_FRONTEND_PATH}/embed.html;
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
add_header Content-Security-Policy "connect-src https: http: 'self'; default-src 'self'; script-src 'self' unpkg.com 'unsafe-inline' 'unsafe-eval'; style-src https: http: 'self' 'unsafe-inline'; img-src https: http: 'self' data:; font-src https: http: 'self' data:; object-src 'none'; media-src https: http: 'self' data:";
|
add_header Content-Security-Policy "connect-src https: http: 'self'; default-src 'self'; script-src 'self' unpkg.com 'unsafe-inline' 'unsafe-eval'; style-src https: http: 'self' 'unsafe-inline'; img-src https: http: 'self' data:; font-src https: http: 'self' data:; object-src 'none'; media-src https: http: 'self' data:";
|
||||||
|
|
Loading…
Reference in New Issue