fix(nginx): Use correct passing in production configs
Part-of: <https://dev.funkwhale.audio/funkwhale/funkwhale/-/merge_requests/2654>
This commit is contained in:
parent
0840aeb943
commit
9dbbe9e768
|
@ -0,0 +1 @@
|
||||||
|
Fix broken nginx templates for docker setup (#2252)
|
|
@ -77,28 +77,6 @@ server {
|
||||||
text/x-cross-domain-policy;
|
text/x-cross-domain-policy;
|
||||||
# end of compression settings
|
# end of compression settings
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
location ~ ^/library/(albums|tracks|artists|playlists)/ {
|
|
||||||
include /etc/nginx/funkwhale_proxy.conf;
|
|
||||||
proxy_pass http://funkwhale-api;
|
|
||||||
}
|
|
||||||
|
|
||||||
location /channels/ {
|
|
||||||
include /etc/nginx/funkwhale_proxy.conf;
|
|
||||||
proxy_pass http://funkwhale-api;
|
|
||||||
}
|
|
||||||
|
|
||||||
location ~ ^/@(vite-plugin-pwa|vite|id)/ {
|
|
||||||
include /etc/nginx/funkwhale_proxy.conf;
|
|
||||||
proxy_pass http://funkwhale-front;
|
|
||||||
}
|
|
||||||
|
|
||||||
location /@ {
|
|
||||||
include /etc/nginx/funkwhale_proxy.conf;
|
|
||||||
proxy_pass http://funkwhale-api;
|
|
||||||
}
|
|
||||||
|
|
||||||
location / {
|
location / {
|
||||||
expires 1d;
|
expires 1d;
|
||||||
include /etc/nginx/funkwhale_proxy.conf;
|
include /etc/nginx/funkwhale_proxy.conf;
|
||||||
|
|
|
@ -105,7 +105,8 @@ server {
|
||||||
|
|
||||||
location ~ ^/@(vite-plugin-pwa|vite|id)/ {
|
location ~ ^/@(vite-plugin-pwa|vite|id)/ {
|
||||||
include /etc/nginx/funkwhale_proxy.conf;
|
include /etc/nginx/funkwhale_proxy.conf;
|
||||||
proxy_pass http://funkwhale-front;
|
alias ${FUNKWHALE_FRONTEND_PATH}/;
|
||||||
|
try_files $uri $uri/ /index.html;
|
||||||
}
|
}
|
||||||
|
|
||||||
location /@ {
|
location /@ {
|
||||||
|
|
|
@ -72,7 +72,8 @@ server {
|
||||||
|
|
||||||
location ~ ^/@(vite-plugin-pwa|vite|id)/ {
|
location ~ ^/@(vite-plugin-pwa|vite|id)/ {
|
||||||
include /etc/nginx/funkwhale_proxy.conf;
|
include /etc/nginx/funkwhale_proxy.conf;
|
||||||
proxy_pass http://funkwhale-front;
|
alias /usr/share/nginx/html/;
|
||||||
|
try_files $uri $uri/ /index.html;
|
||||||
}
|
}
|
||||||
|
|
||||||
location /@ {
|
location /@ {
|
||||||
|
|
|
@ -113,23 +113,20 @@ server {
|
||||||
text/x-component
|
text/x-component
|
||||||
text/x-cross-domain-policy;
|
text/x-cross-domain-policy;
|
||||||
# end of compression settings
|
# end of compression settings
|
||||||
|
|
||||||
{% if not config.reverse_proxy %}
|
{% if not config.reverse_proxy %}
|
||||||
|
|
||||||
# headers
|
# headers
|
||||||
add_header Content-Security-Policy "default-src 'self'; connect-src https: wss: http: ws: 'self' 'unsafe-eval'; script-src 'self' 'wasm-unsafe-eval'; style-src https: http: 'self' 'unsafe-inline'; img-src https: http: 'self' data:; font-src https: http: 'self' data:; media-src https: http: 'self' data:; object-src 'none'";
|
add_header Content-Security-Policy "default-src 'self'; connect-src https: wss: http: ws: 'self' 'unsafe-eval'; script-src 'self' 'wasm-unsafe-eval'; style-src https: http: 'self' 'unsafe-inline'; img-src https: http: 'self' data:; font-src https: http: 'self' data:; media-src https: http: 'self' data:; object-src 'none'";
|
||||||
add_header Referrer-Policy "strict-origin-when-cross-origin";
|
add_header Referrer-Policy "strict-origin-when-cross-origin";
|
||||||
add_header X-Frame-Options "SAMEORIGIN" always;
|
add_header X-Frame-Options "SAMEORIGIN" always;
|
||||||
add_header Service-Worker-Allowed "/";
|
add_header Service-Worker-Allowed "/";
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
{% if not config.reverse_proxy %}
|
|
||||||
location /api/ {
|
location /api/ {
|
||||||
include /etc/nginx/funkwhale_proxy.conf;
|
include /etc/nginx/funkwhale_proxy.conf;
|
||||||
# This is needed if you have file import via upload enabled.
|
# This is needed if you have file import via upload enabled.
|
||||||
client_max_body_size ${NGINX_MAX_BODY_SIZE};
|
client_max_body_size ${NGINX_MAX_BODY_SIZE};
|
||||||
proxy_pass http://funkwhale-api;
|
proxy_pass http://funkwhale-api;
|
||||||
}
|
}
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
location ~ ^/library/(albums|tracks|artists|playlists)/ {
|
location ~ ^/library/(albums|tracks|artists|playlists)/ {
|
||||||
include /etc/nginx/funkwhale_proxy.conf;
|
include /etc/nginx/funkwhale_proxy.conf;
|
||||||
|
@ -143,13 +140,23 @@ server {
|
||||||
|
|
||||||
location ~ ^/@(vite-plugin-pwa|vite|id)/ {
|
location ~ ^/@(vite-plugin-pwa|vite|id)/ {
|
||||||
include /etc/nginx/funkwhale_proxy.conf;
|
include /etc/nginx/funkwhale_proxy.conf;
|
||||||
|
{% if config.proxy_frontend %}
|
||||||
proxy_pass http://funkwhale-front;
|
proxy_pass http://funkwhale-front;
|
||||||
|
{% else %}
|
||||||
|
{% if config.inside_docker %}
|
||||||
|
alias /usr/share/nginx/html/;
|
||||||
|
{% else %}
|
||||||
|
alias ${FUNKWHALE_FRONTEND_PATH}/;
|
||||||
|
{% endif %}
|
||||||
|
try_files $uri $uri/ /index.html;
|
||||||
|
{% endif %}
|
||||||
}
|
}
|
||||||
|
|
||||||
location /@ {
|
location /@ {
|
||||||
include /etc/nginx/funkwhale_proxy.conf;
|
include /etc/nginx/funkwhale_proxy.conf;
|
||||||
proxy_pass http://funkwhale-api;
|
proxy_pass http://funkwhale-api;
|
||||||
}
|
}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
location / {
|
location / {
|
||||||
expires 1d;
|
expires 1d;
|
||||||
|
|
Loading…
Reference in New Issue