Hello,
You can make NGINX listen to specific directories
and domains
. With the use of VHOSTS you can basically run an unlimited amount of websites on your webserver as long as you have resources.
To do what you want, I wouldn’t make it to difficult; you can just edit your default nginx configuration file (I would rename it just for developer knowledge) and then make a directory for the /redmine
So; inside your /var/www/html
make a directory called redmine
and put all your redmine files in there. Now you can put your main website inside the “root” directory /var/www/html
. Your directory will then look like this:
- /var/www/html –> your wiki files
- /var/www/html/redmine –> your redmine files
Now you can just edit your NGINX configuration to serve both webdirectories. First rename your default configuration:
sudo rm /etc/nginx/sites-enabled/default
sudo mv /etc/nginx/sites-available/default /etc/nginx/sites-available/hackerspaceqx.com
sudo ln -s /etc/nginx/sites-available/hackerspaceqx.com /etc/nginx/sites-enabled/hackerspaceqx.com
This doesn’t really matter, the name is just for developers to know what kind of configuration it is.
Now edit the configuration file and restart the nginx service:
sudo nano /etc/nginx/site-available/hackerspaceqx.com
with the following content:
(may be a bit different than what you have now, if you use PHP you need to have the PHP socket in there as well)
server {
listen 80 default_server;
listen [::]:80 default_server;
root /var/www/html;
index index.html index.htm index.nginx-debian.html;
server_name hackerspaceqx.com www.hackerspaceqx.com;
location / {
try_files $uri $uri/ =404;
}
location /redmine {
try_files $uri $uri/ =404;
}
}
Now restart nginx
sudo service nginx restart
I hope this will help you out, if you have got any more questions don’t hesistate to ask me!