Skip to content
● Grav 2.2 is out: 2x faster cold starts and 96% less memory on big sites. Read the announcement →

Subfolders in nginx

Started by Muut Archive 11 years ago · 1 replies · 934 views
11 years ago

I am trying to configure multiple grav sites as subfolders in nginx. I am working on Ubuntu and following the learn.getgrav Digital Ocean config tutorial and have successfully installed a single grav site with the basic 'grav' config file in /etc/nginx/sites-available

I am now trying to install multiple sites as subfolders. As a first attempt, I have installed another instance of grav in /home/grav/www/html/sysmanual/

Then, in the config file, after the server section, I added a subfolder section:

location /sysmanual/ {
root /pi
try_files $uri $uri/ /index.html;
if (!-e $request_filename){ rewrite ^(.*)$ /sysmanual/index.php last; }
}

However, when I go to localhost/digitalocean.dev/sysmanual it does not work.

Can anybody say what I am doing wrong? Do I need to adjust the server section of the config?

11 years ago

I fixed this in the end by editing /etc/hosts
I changed the line:
127.0.0.1 localhost
To:
127.0.0.1 sysmanual policyman

This means I can go to http://sysmanual or http://policyman as they have been configured in sites available and sites enabled

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 2500 9 years ago
Archive · by Muut Archive, 9 years ago
2 1654 9 years ago
Archive · by Muut Archive, 9 years ago
2 4931 9 years ago
Archive · by Muut Archive, 9 years ago
1 3746 9 years ago
Archive · by Muut Archive, 9 years ago
3 1770 9 years ago