diff --git a/nginx.conf b/nginx.conf index afa450c23..7e7147adc 100644 --- a/nginx.conf +++ b/nginx.conf @@ -26,6 +26,21 @@ http { if (!-e $request_filename){ rewrite ^(.*)$ /index.php last; } } + # if you want grav in a sub-directory of your main site + # (for example, example.com/mygrav) then you need this rewrite: + location /mygrav { + index index.php; + if (!-e $request_filename){ rewrite ^(.*)$ /mygrav/$2 last; } + try_files $uri $uri/ /index.php?$args; + } + + # if using grav in a sub-directory of your site, + # prepend the actual path to each location + # for example: /mygrav/images + # and: /mygrav/user + # and: /mygrav/cache + # and so on + location /images/ { # Serve images as static }