- Update virtual host file
Step 1:
$ suno nano /etc/nginx/sites-available/<file-name>
Step 2:
$ sudo service nginx reload
- Enable htaccess in nginx
Step 1:
Make sure that you have below line in your host file:
try_files $uri $uri/ /index.php?$args;
Resource: https://www.digitalocean.com/community/questions/enabling-nginx-mod_rewrite
Your server block should look like:
server{
.....
location / {
try_files $uri $uri/ /index.php?$args;
}
.......
}
Step 2:
$ sudo service nginx reload
- Activate the host by creating a symbolic link between the sites-available directory and the sites-enabled directory.
$ sudo ln -s /etc/nginx/sites-available/example.com /etc/nginx/sites-enabled/example.com
$ sudo service nginx restart