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

Proxy original Neos URL, not just Base URI #40

Open
sbruggmann opened this issue Sep 25, 2022 · 0 comments
Open

Proxy original Neos URL, not just Base URI #40

sbruggmann opened this issue Sep 25, 2022 · 0 comments

Comments

@sbruggmann
Copy link

sbruggmann commented Sep 25, 2022

Would it be possible to keep the original resource urls?
This would make a migration easier because no assets need to be redirected, etc.

Example

Before switching to gcs:
client.com/_Resources/Persistent/4/c/f/e/4cfe35...57a2/Uploaded.jpg

After switching to gcs:
storage.googleapis.com/bucket-name/4cfe35...57a2/Uploaded.jpg

After using custom Base URI:
client.com/bucket-name/4cfe35...57a2/Uploaded.jpg
And nginx needs a proxy like

location ~* ^/bucket-name/(.*)$ {
  proxy_pass https://storage.googleapis.com;
}

And we need to redirect the old requests like

location ~* ^/_Resources/Persistent/[0-9a-z]/[0-9a-z]/[0-9a-z]/[0-9a-z]/(.*)$ {
  return 301 https://storage.googleapis.com/bucket-name/$1;
}

But if we could still could have the original Neos url:
client.com/_Resources/Persistent/4/c/f/e/4cfe35...57a2/Uploaded.jpg
Nginx could proxy the requests directly like

location ~* ^/_Resources/Persistent/[0-9a-z]/[0-9a-z]/[0-9a-z]/[0-9a-z]/(.*)$ {
  rewrite ^/_Resources/Persistent/[0-9a-z]/[0-9a-z]/[0-9a-z]/[0-9a-z]/(.*)$ /bucket-name/$1 break;
  proxy_pass https://storage.googleapis.com;
}
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

1 participant