Skip to content
GitLab
About GitLab
GitLab: the DevOps platform
Explore GitLab
Install GitLab
How GitLab compares
Get started
GitLab docs
GitLab Learn
Pricing
Talk to an expert
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Projects
Groups
Snippets
Sign up now
Login
Sign in
Toggle navigation
Menu
Open sidebar
project
provision
Commits
f56ee17d
Commit
f56ee17d
authored
Dec 03, 2014
by
Grazyna Jaworska
Browse files
Nginx: Helper locations to avoid 404 on legacy images paths (subdir only)
parent
2266d414
Changes
1
Hide whitespace changes
Inline
Side-by-side
http/Provision/Config/Nginx/subdir.tpl.php
View file @
f56ee17d
...
...
@@ -39,6 +39,40 @@ if ($main_site_name = '') {
set $main_site_name "$server_name";
}
<?php
if
(
$nginx_config_mode
==
'extended'
)
:
?>
###
### Helper locations to avoid 404 on legacy images paths
###
location ^~ /
<?php
print
$subdir
;
?>
/sites/default/files {
root
<?php
print
"
{
$this
->
root
}
"
;
?>
;
location ~* ^/
<?php
print
$subdir
;
?>
/sites/default/files/imagecache {
access_log off;
log_not_found off;
expires 30d;
set $nocache_details "Skip";
rewrite ^/
<?php
print
$subdir
;
?>
/sites/default/files/imagecache/(.*)$ /
<?php
print
$subdir
;
?>
/sites/$main_site_name/files/imagecache/$1 last;
try_files $uri @drupal_
<?php
print
$subdir
;
?>
;
}
location ~* ^/
<?php
print
$subdir
;
?>
/sites/default/files/styles {
access_log off;
log_not_found off;
expires 30d;
set $nocache_details "Skip";
rewrite ^/
<?php
print
$subdir
;
?>
/sites/default/files/styles/(.*)$ /
<?php
print
$subdir
;
?>
/sites/$main_site_name/files/styles/$1 last;
try_files $uri @drupal_
<?php
print
$subdir
;
?>
;
}
location ~* ^/
<?php
print
$subdir
;
?>
/sites/default/files {
access_log off;
log_not_found off;
expires 30d;
rewrite ^/
<?php
print
$subdir
;
?>
/sites/default/files/(.*)$ /
<?php
print
$subdir
;
?>
/sites/$main_site_name/files/$1 last;
try_files /$1 $uri =404;
}
}
<?php
endif
;
?>
###
### Master location for subdir support (start)
###
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment