Discover Centmin Mod today
Register Now

IP.Board Proper Nginx rule when forum is inside a folder

Discussion in 'Forum software usage' started by pamamolf, Jul 19, 2019.

  1. pamamolf

    pamamolf Premium Member Premium Member

    3,857
    378
    83
    May 31, 2014
    Ratings:
    +729
    Local Time:
    5:28 PM
    Nginx-1.17.x
    MariaDB 10.3.x
    Hello

    I would like to ask what rule do you use for Nginx to get the forum working if it is on a folder like:

    Code:
    /home/nginx/domains/mydomain.com/public/forum/
    Do you adjust also the root path at Nginx config ?

    @Jimmy
    Maybe you can help also as you are using Invision?

    Thank you
     
  2. Jimmy

    Jimmy Well-Known Member

    1,706
    365
    83
    Oct 24, 2015
    East Coast USA
    Ratings:
    +923
    Local Time:
    10:28 AM
    1.17.x
    MariaDB 10.3.x
    Yes, you would have to set the root to that folder.
     
  3. eva2000

    eva2000 Administrator Staff Member

    45,405
    10,302
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,980
    Local Time:
    12:28 AM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    using
    Code (Text):
    location /forum {
     your code
    }

    doesn't work ?
     
  4. Jimmy

    Jimmy Well-Known Member

    1,706
    365
    83
    Oct 24, 2015
    East Coast USA
    Ratings:
    +923
    Local Time:
    10:28 AM
    1.17.x
    MariaDB 10.3.x
    I believe you can do it either way depending on what you're trying to do.

    I've never run the forum on /forum but if someone wants to only have the forum on their site and nothing in the / then I believe you'd have to set the root as /forum, otherwise the location /forum would be used.
     
  5. pamamolf

    pamamolf Premium Member Premium Member

    3,857
    378
    83
    May 31, 2014
    Ratings:
    +729
    Local Time:
    5:28 PM
    Nginx-1.17.x
    MariaDB 10.3.x
    Don't know what to use there:

    Code:
    location /forums {
      try_files    $uri $uri/ /forums/index.php;
    }
    or

    Code:
    location /forum/ {
      rewrite ^/forum/(.*)$ /forum/index.php;
    }
    All that confusing me :)
     
  6. eva2000

    eva2000 Administrator Staff Member

    45,405
    10,302
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,980
    Local Time:
    12:28 AM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    1st one