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

content redirect from one site to another when using subdomain for sites/default/files in drupal #283

Open
gs9999 opened this issue May 3, 2018 · 1 comment

Comments

@gs9999
Copy link

gs9999 commented May 3, 2018

Hello Perusio,

I HAD come across another article/ post of yours a while back, where you had something that, unfortunately, I cut and paste, however, can't currently find again, that made it so that on a static serving nginx website,

that I am using to host sites/default/files content, on a subdomain, in drupal,

there was a DIRECTIVE that made it so nginx would try to load from the subdomain location {}, and for imagestyles purposes, would try to load from the www.example.com main drupal domain, so that the image would be generated, if it was not available on the subdomain i.e. (content.example.com) @ nginx serving time.

could you mind posting the info here in this forum, so that those of us that use this www.github.com/perusio/drupal-with-nginx easily reference when re-building servers?

Thanks.

GS

@gs9999
Copy link
Author

gs9999 commented May 8, 2018

Hello everybody,

I was able to find the nginx config code/language that I was looking for. For anyone else looking for this subject matter. It goes like this

put this at the head of your config

map $uri&$args $no_slash_uri { ~^/(?<no_slash>.*)$ $no_slash; }

the in a server curly brace or directive, put the following location --

location ~* /sites/default/files/styles/* {

          access_log off;
          expires 30d;

   error_page 400 = https://www.example.com/index.php?q=$no_slash_uri;
   error_page 500 = https://www.example.com/index.php?q=$no_slash_uri;
   error_page 404 = https://www.example.com/index.php?q=$no_slash_uri;
}

thanks, perusio for all your help and assistance--glad I could contribute back.

GS

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