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

Reverse proxy to new base path breaks web app #353

Open
JabDevs opened this issue Jan 16, 2025 · 3 comments
Open

Reverse proxy to new base path breaks web app #353

JabDevs opened this issue Jan 16, 2025 · 3 comments
Assignees

Comments

@JabDevs
Copy link

JabDevs commented Jan 16, 2025

I have setup a proxy with apache2 with:

<VirtualHost *:443>
    ServerName some.ip

    SSLEngine On
    SSLCertificateFile /certs/domain.crt
    SSLCertificateKeyFile /certs/domain.key

    ProxyPreserveHost On
    ProxyRequests Off

    # dolt-workbench
    ProxyPass /dolt-workbench http://some.ip:3000
    ProxyPassReverse /dolt-workbench http://some.ip:3000
</VirtualHost>

However, then connecting to "https://some.ip/dolt-workbench" just provides a blank, white page. There are console errors (404) for "https://some.ip/_next/static/...".

I would imagine there are some configs for changing the base path so that the configs could be at "https://some.ip/dolt-workbench/static/..." instead, but I could not find this config. I imagine I could build from source and change configs in "./web", but a parameter to be passed to the "docker run ..." step would be a better solution.

Thanks.

@tbantle22 tbantle22 self-assigned this Jan 16, 2025
@tbantle22
Copy link
Collaborator

Hi @JabDevs, it looks like we do need to provide a parameter to change the base path in the Next.js application. I will look into this today and keep you updated

@tbantle22
Copy link
Collaborator

Updating the base config is a little more complicated than I originally thought but I'm working on it. In the meantime you may be able to get around this by rewriting the url like this:

RewriteEngine On
RewriteRule ^/_next/(.*)$ /dolt-workbench/_next/$1 [P,L]

@JabDevs
Copy link
Author

JabDevs commented Jan 21, 2025

Hi @tbantle22, thanks for the speedy response.

Updating the config with :

RewriteEngine On
RewriteCond %{REQUEST_URI} ^/_next
RewriteRule ^/_next/(.*)$ /dolt-workbench/_next/$1 [R=301,L]

only partially proxies the Next.js application. The configs are still expected to be at "https://some.ip/api/config", and other files at "https://some.ip/images/dolt-workbench.png" and "https://some.ip/favicon/site.webmanifest".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants