You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Due to a bug in Rails' ActiveStorage (rails/rails#43633), the URL's generated by the API pointing to files stored using ActiveStorage are not on the desired subdirectory if relative_url_root is used.
It is unfortunately our hands to fix this.
Workaround
You can avoid this issue by using another application/proxy to take care of hosting the Dolos API on a subdirectory (like Phusion Passenger's passenger_base_uri), or by adding an extra redirect location from /rails/* to /rails/api/*.
For example for NGINX, the following snippet would host Dolos on https://dolos.localhost:9090:
http {
upstreamdolos-api {
server api:3000;
}
server {
listen9090 ssl;
server_name dolos.localhost;
ssl_certificate /root/ssl/cert.crt;
ssl_certificate_key /root/ssl/cert.key;
# Serve the static front-end fileslocation/ {
root /path/to/dolos-web;
}
location/api {
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Host 'dolos.localhost:9090';
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_pass http://dolos-api/;
}
# Required due to a bug in Rails' ActiveStoragelocation/rails {
return302 https://dolos.localhost:9090/api$request_uri;
}
}
}
The text was updated successfully, but these errors were encountered:
Due to a bug in Rails' ActiveStorage (rails/rails#43633), the URL's generated by the API pointing to files stored using ActiveStorage are not on the desired subdirectory if
relative_url_root
is used.It is unfortunately our hands to fix this.
Workaround
You can avoid this issue by using another application/proxy to take care of hosting the Dolos API on a subdirectory (like Phusion Passenger's
passenger_base_uri
), or by adding an extra redirect location from/rails/*
to/rails/api/*
.For example for NGINX, the following snippet would host Dolos on
https://dolos.localhost:9090
:The text was updated successfully, but these errors were encountered: