Skip to content
Grav 2.0 is officially stable. Read the announcement →
Archive

Subfolders in nginx

Started by Muut Archive 10 years ago · 1 replies · 728 views
10 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?

10 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 1354 9 years ago
Archive · by Muut Archive, 9 years ago
2 935 9 years ago
Archive · by Muut Archive, 9 years ago
2 4065 9 years ago
Archive · by Muut Archive, 9 years ago
1 2953 9 years ago
Archive · by Muut Archive, 9 years ago
3 1119 9 years ago