Skip to content

Proxy original Neos URL, not just Base URI #40

Description

@sbruggmann

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;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions