Closed tamas6 closed 6 months ago
Confirm. -Login to https://app.fairdrive.dev.fairdatasociety.org/ -Reload the page, get error
NEW case. After this, simple delete the /overview/ part of the url simulating -redirecting to login page- This happened. Spooky
There is no /overview/ in static... that shows in url works only because of js router in index so if you reload it wants to load /overview/index.xx which doesnt exist
There is no /overview/ in static... that shows in url works only because of js router in index so if you reload it wants to load /overview/index.xx which doesnt exist
I mean we need to configure Nginx like this:
server {
location / {
try_files $uri $uri/ /index.html;
}
}
Can we do this?
This is exactly what we have https://github.com/fairDataSociety/fairdrive-theapp/blob/e1c8c124cbba388567c991bb956ec6763768e693/Dockerfile#L83
$uri is a variable that contains overview in our example case. If you look in static export there is no overview file, no overview folder so that can not work. You have to change source code so that these pages are generated.
https://nextjs.org/docs/pages/building-your-application/deploying/static-exports
This is exactly what we have
$uri is a variable that contains overview in our example case. If you look in static export there is no overview file, no overview folder so that can not work. You have to change source code so that these pages are generated.
https://nextjs.org/docs/pages/building-your-application/deploying/static-exports
I looked at the build in the out
directory. It has an overview
directory, but there is no index.html
in it.
Using the link you provided, what can I do to make sure everything works as it should?
I configured something similar for Apache, but nginx may require some additional configuration. The main goal is for all unfound routes to be processed by index.html
Example for Apache
<Directory /var/www/html>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
RewriteEngine on
# If the requested resource is a file (but not directory), go to it as it is
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -f
RewriteRule ^ - [L]
# For other cases (including if the directory exists but doesn't contain an index.html), use index.html
RewriteRule^/index.html
</Directory>
If overview folder exists and its empty explains why we get 403 and not 404 or index.html.
If we remove "$uri/" that will fix the 403.
We shouldnt have an empty folder produced by static export build
What ever we hack in web server the following issues will persist:
- on reload you always get login page even if you have just logged in.
In any case, after reloading the page, the login is reset and you need to log in again
- on reload you always get login page even if you have just logged in.
In any case, after reloading the page, the login is reset and you need to log in again
Dunno if we declare that a feature or a "bug"
I’d prioritise this, stale issue for 3 weeks now
related to #234 probably.
url remains: https://app.fairdrive.dev.fairdatasociety.org/overview/