Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hardcoded absolute URL paths everywhere #1357

Closed
ghost opened this issue Apr 27, 2023 · 1 comment
Closed

hardcoded absolute URL paths everywhere #1357

ghost opened this issue Apr 27, 2023 · 1 comment
Labels
duplicate There is already an issue on this topic ⚡ Type: Bug Something isn't working

Comments

@ghost
Copy link

ghost commented Apr 27, 2023

Mainsail Version:

2.5.1

Browser:

Firefox

Device:

Laptop

Operating System:

Linux

What happened?

the server hosting hosts other apps, so I have nginx configured to serve the app at /mainsail, instead of /. But this doesn't work, as throughout the HTML, JS, and CSS, there's hardcoded absolute paths assuming the app is hosted at /. I have this awful hack in my nginx config to make it temporarily sorta work:

location / {
  try_files $uri $uri/ /mainsail/$uri /mainsail/$uri/ =404;
}

but it's not great, and even with this ugly workaround, it's still not perfect, something in the JS is using the history API to overwrite the URL bar, resetting the path back to /.

Just one example of the problem, note the leading slash:

<script type="module" src="/src/main.ts"></script>

What did you expect to happen instead?

I expected the app to use relative URLs

How to reproduce this bug?

Install mainsail to a subdirectory of nginx's root directory

Additional information:

No response

@ghost ghost added the ⚡ Type: Bug Something isn't working label Apr 27, 2023
@ghost ghost changed the title hardcoded absolute paths everywhere hardcoded absolute URL paths everywhere Apr 27, 2023
@meteyou
Copy link
Member

meteyou commented Apr 27, 2023

Duplicate of #1163

@meteyou meteyou marked this as a duplicate of #1163 Apr 27, 2023
@meteyou meteyou closed this as not planned Won't fix, can't repro, duplicate, stale Apr 27, 2023
@meteyou meteyou added the duplicate There is already an issue on this topic label Apr 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate There is already an issue on this topic ⚡ Type: Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant