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

Nginx tweaks #15

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion nginx-site.conf.example
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ server {
# then create a separate rule that covers strictly what you expect and nothing wider.
# You want to ensure that any files a developer might accidentally create/leave around
# like backups, sql dumps etc. are not world-accessible.
location ~ ^/(public|core|ext)/.*\.(png|css|jpg|js|mjs|gif|ico|svg|woff2|html)$ {
location ~ ^/(public|core|ext)/.*\.(png|css|jpg|js|mjs|json|webp|gif|ico|svg|woff2|html)$ {
# Return the file if it exists, or a 404
try_files $uri 404;
}
Expand All @@ -169,6 +169,14 @@ server {
fastcgi_pass php-fpm;
}


# @todo If you have migrated from Drupal7 and moved your images
# to the new location, you can use something like this which will
# allow requests to the old paths to serve the images from their new paths.
# location /sites/default/files/civicrm/persist/contribute/images/ {
# alias /var/www/example.org/docroot/public/media/images/;
# }

# Default location.
location / {
return 404;
Expand Down