Broken link to /stats on nginx

Discussion in 'Installation/Configuration' started by jkounis, Jul 8, 2014.

  1. jkounis

    jkounis New Member

    I followed the procedure in http://www.howtoforge.com/the-perfe...bind-mysql-php-postfix-dovecot-and-ispconfig3 to set up a service with nginx/ispconfig3.

    After I created a site with awstats enabled, I found that I received a 404 error if I clicked on Statistics->Web Traffic from the Sites tab of ISPConfig.

    The problem is that the webstatistics are available at http://example.com/stats/, but the Web Traffic page links to http://example.com/stats (without the trailing slash), which causes a 404 error.

    For now, my workaround is to add the following line to the "Redirect" tab on the Web Domain Page ("Website" on the Sites tab):
    Code:
    rewrite ^/stats$ /stats/ redirect;
    (Note I tried using the last and break flags, e.g. "rewrite ^/stats$ /stats/ last;", and that didn't work. You have to use redirect to get the browser to redirect to the new URL.)
    If this is the appropriate change, I could change the template at /usr/local/ispconfig/server/conf/nginx_vhost.conf.master to always include this redirect line.

    Am I doing something wrong, or is there a better way to fix the 404 error for site statistics?
     
    Last edited: Jul 8, 2014

Share This Page