Nginx forum in subdir

  • Affected Version
    WoltLab Suite 3.0

    So i just cleaned up my nginx vhost with the following BB nginx code:

    Code
    location /forum/ {
        index index.php;
    
        try_files $uri $uri/ @forum;
    }
    location @forum {
        rewrite ^/(forum/|cms/|wcf/|core/|calendar/|filebase/|blog/|gallery/)?([^.]+)$ /$1index.php?$2 last;
    }
    
    <drupal Vhost code goes here>

    but with this i can't install a package and i can't access anything other then topics and the admin control panel.


    The setup is as follows:

    domain.tld(drupal site)
    domain.tld/forum --->burning board

  • Your rewrite doesn't make any sense, because ^/… is absolute to the domain root. Change it to read rewrite ^/forum/(cms/|wcf/|…, and you should be done.

    Alexander Ebert
    Senior Developer WoltLab® GmbH

  • Change it to read rewrite ^/forum/(cms/|wcf/|…, and you should be done.


    Changed it to
    location @forum { rewrite ^/forum/(cms/|wcf/|.....}


    When i do it like this, its stops working completely.. then it redirects me to the frontpage with a page not found.

  • This fixed it for me:

    Code
    location /forum/ {
        index index.php;
    
        try_files $uri $uri/ @forum;
    }
    
    location @forum {
        rewrite ^/forum/(core/|cms/|wcf/|calendar/|filebase/|blog/|gallery/)?([^.]+)$ /forum/$1index.php?$2 last;
    }


    Thanks :)