Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Nginx and Vanilla 2

edited March 2010 in Vanilla 2.0 - 2.8
I have read and recreated the config files from - but have not been able to get everything working properly. Generally the index.php file loads, but any subsequent page doesn't load. It's clear this has to do with the rewrites.

Would anyone be willing to help me with this issue, maybe via PM or through the threads. I have been trying to walk through this in the #nginx IRC channel, but it's clear I need the help of someone more familiar with Vanilla.


  • Options
    I've gotten much closer with this issue using the #nginx location directive -

    Here is the server declaration I am using currently -

    It passes all uri data as query strings to /forums/index.php (which is the location of my vanilla install). What is happening is that Vanilla is not parsing these queries and just displaying the landing (homepage).

    Does anyone have anymore information on how Vanilla parses the URI and dispatches it? Am I breaking it because I am sending the queries with q=$query? Any help would be appreciated.
  • Options
    lucluc ✭✭
    We can't really help as we haven't got the contents of the "php" file.

    It's much easier to set up using an "virtual host" instead of trying to have running from a directory name.
  • Options
    I was able to get this working, but not without hacking the Vanilla Core bit, which I was really trying to avoid. The main issue was that Vanilla was using PATH_INFO to parse the URL's, but #nignx wasn't producing a proper PATH_INFO.

    In the file class.url.php the function actually uses 3 different techniques to parse the url, PATH_INFO, ORIG_PATH_INFO, and PHP_SELF. I simply added a block that used REQUEST_URI. I also had to use the SCRIPT_NAME to filter out the subfolder, in my case /forums, from the REQUEST_URI.

    This might be a unique problem to me, and not help many other people, but in the class.url.php there is a TODO that says: "Test this on various platforms/browsers. Very breakable." So I thought this may be one of those cases. Again, this may not help anyone else but me, but I think it's worth to have out there, just in case.
  • Options
    lucluc ✭✭
    edited March 2010
    You could (may) have just set path_info as request_uri within nginx fast_cgi param.

    Anyway, maybe your change will help people using apache to have vanilla2 work from within a subdirectory.
Sign In or Register to comment.