Do you want to add statistics route with your MERN applications?
- If you didn't setup Hestiacp then Click here to see installation instructions.
If you already deployed the app with HestiaCP. Now open your domain to setup statistics.
Follow the instruction below:
- Login to the panel. visit: your-ip:8083
- Visit "Web" menu and choose your domain.
- Click on the "Edit Domain" icon.
- Now click on "Web Statistics" option and select "awstats".
- Now Save this.
It will take a while to setup.
If your application handles unknown routes automatically the you should update configuration of the Nginx.
- Login into the hosting server using ssl as described in this article
- Go to the Nginx configuration file using command like:
cd /home/bdcommerce/conf/web/demo.bdcommerce.app
- Now edit nginx.conf file in nano editor. Command:
nano nginx.conf
Note: If it's immutable unmute it. Command:
chattr -i nginx.conf
- Add /vstats route between location ~ /.(?!well-known\/|file) { & location / {
Code:
location /vstats {
alias /home/demo.bdcommerce.app/web/demo.bdcommerce.app/stats;
index index.html;
}
It will be positioned like the SS below:
Do the same job for nginx.ssl.conf (Repeat Point 3 & 4 at the stage)
Now restart the nginx server:
sudo systemctl restart nginx
- Visit your statistics route to see the statistics like: https://your-domain/vstats
Note: If it works then don't forget to make config file immutable.
Thanks,
N I Rimon
Top comments (0)