/arcade = works | /arcade.php = NOPE

Would you mind copy-pasting your nginx.conf file, or the one that contains the configuration for your site? I'd like to see the whole part so I can try writing a code that works.

Also, you did replace "/path-to-forums/" next to "location " with the correct path to your forum, right? In that case, then try this:

Remember to delete first the one I suggested if it is still there. Then replace it with this:

Code:
location / {
    index index.php index.html;
    try_files $uri $uri/ $uri.php?$uri&$args;
}
 
location /forum {
    try_files $uri $uri/ $uri.php?$uri&$args;
}
 
location /forum/ {
    try_files $uri $uri/ $uri.php?$uri&$args;
}

Remember to backup your existing config first, as always. Let me know how that works out. Make sure you restart the NginX service after that, and then remember to clear your browser cache before attempting to access the resource again. Also, you do not need to change anything in the code above, since I already took the liberty of adding your forum path (/forum/) to it.
 
I'll give those suggestions a go in a bit mate, going to go and do a bit of housework but will report back. Here's my conf as it stands, btw my forum is installed in the root. I've got this addon installed which does an internal redirect. :)

Code:
server {
    listen                80;
    server_name            the-sps.org;
    rewrite ^            http://www.the-sps.org$request_uri? permanent;
}
 
server {
    listen                80 default_server;
    server_name            www.the-sps.org;
    access_log            off;
    error_log            /srv/www/the-sps.org/logs/error.log;
    root                /srv/www/the-sps.org/public_html;
    index                index.php index.html;
 
    location / {
    try_files $uri $uri/ /index.php?$uri&$args;
    index index.php index.html;
    }
   
    location /internal_data/ {
    internal;
    }
   
    location /library/ {
    internal;
    }
 
    location ~ \.php$ {
        try_files        $uri =404;
        fastcgi_split_path_info    ^(.+\.php)(/.+)$;
        fastcgi_pass        127.0.0.1:9000;
        fastcgi_param        PATH_INFO    $fastcgi_path_info;
        fastcgi_param        PATH_TRANSLATED    $document_root$fastcgi_script_name;
        include            fastcgi_params;
    }
}
 
server {
  server_name c.the-sps.org;
  access_log off;
  error_log /srv/www/the-sps.org/logs/error.log;
  root /srv/www/the-sps.org/public_html;
 
  location / {
    return 403;
  }
 
  location ~* ^.+\.(jpg|jpeg|gif|png|ico|swf|css|js)$ {
    access_log      off;
    expires        45d;
  }
}
 
I've changed my code above, seems I forgot $args (I put in only &args). By any chance, is this:
Code:
rewrite ^ http://www.the-sps.org$request_uri? permanent;

For your xenPorta addon? I'm not sure what exactly the problem is right here, but try giving my code above a shot first. That might help. If not, then sorry, not my best day. BTW, make a backup of your config before modifying it, as always.
 
By any chance, is this:
Code:
rewrite ^ http://www.the-sps.org$request_uri? permanent;

For your xenPorta addon?

It's not, no. :) It's just to rewrite http://the-sps.org to http://www.the-sps.org.

I've changed my code above, seems I forgot $args (I put in only &args).I'm not sure what exactly the problem is right here, but try giving my code above a shot first. That might help. If not, then sorry, not my best day. BTW, make a backup of your config before modifying it, as always.

Tried your code above, although www.the-sps.org was available I could not reach my forum at /forum instead I got a 404 further I tried www.the-sps.org/arcade.php and got a 404. :(
 
One last thing for anyone running a NginX webserver try the following at your forum address

http://www.example.com/madeup.php

Where "example.com" is your forum url, do you get a NginX 404 or do you get the XenForo 404 page, you should be getting the XenForo 404 but I bet you're all getting the NginX page.
 
But http://www.rocketslice.com/community/madeup.php doesn't in that it shows the nginx 404 error page instead of the default XF 'page not found' error page. :( With XFA there is no "arcade.php" physical file (since it is using the XF route model), instead with XF under Apache & the default .htaccess rules "{xf}/arcade.php" brings up the same page as "{xf}/arcade" and from there it captures the _request variables to record scores for some games. What ChemicalKicks is finding on his server with nginx is that the "{xf}/arcade" request loads fine but "{xf}/arcade.php" results in the nginx 404 page instead of the XF page handling.
 
There must be something missing in our configs or maybe there's some fundamental conflict between XenForo and Nginx that prevents internal url handling.

rocketslice.com/community/madeup.php throws up nginx 404
 
So say something like this :)


Code:
location / {
try_files $uri $uri/ /index.php?$uri&$args;
index index.php index.html;
rewrite /arcade.php /arcade redirect;
}

I believe the rewrite must come before try_files

Also if you are getting 404's regardless of try_files on .php files there is something wrong with the fastcgi part of your config
 
But http://www.rocketslice.com/community/madeup.php doesn't in that it shows the nginx 404 error page instead of the default XF 'page not found' error page. :( With XFA there is no "arcade.php" physical file (since it is using the XF route model), instead with XF under Apache & the default .htaccess rules "{xf}/arcade.php" brings up the same page as "{xf}/arcade" and from there it captures the _request variables to record scores for some games. What ChemicalKicks is finding on his server with nginx is that the "{xf}/arcade" request loads fine but "{xf}/arcade.php" results in the nginx 404 page instead of the XF page handling.

I didn't set up the xenForo rewrite rules to my server yet, so it will show the NginX 404 instead of XF's. But regardless of the case, I think you're right about xenForo following the xenForo route model. Are you sure arcade.php is in the ROOT folder of your site?
 
I didn't set up the xenForo rewrite rules to my server yet, so it will show the NginX 404 instead of XF's. But regardless of the case, I think you're right about xenForo following the xenForo route model. Are you sure arcade.php is in the ROOT folder of your site?
That's just it, there is no physical "arcade.php", it doesn't exist. With XF under Apache using the .htaccess file that comes shipped with XF, both "arcade.php" and "arcade" handled by having a route for "arcade" and the request is handled correctly. When some arcade games post their scores back they explicitly post back to "arcade.php" (it is in the SWFs AS, not something that can be changed) and it shouldn't be a problem with XFs handling (in that XF's index.php is the real index page being served and then internally XF handles the route handling to determine what content to served).

To look at it another way...

These URLs go to the same page here at XF.com even though there is no physical file named "members.php" in the /community folder, just a route to "members" that is handled by XF. Clicking on either of those links brings up the XF members page as expected.

By contrast check the URLs below. With Nginx the URL containing the page extension is not working. You mentioned you haven't implemented the rules yet on your server so it is to be expected that it fails on your site but it should be working on CK's site.

Now where it gets even more fun is that it does not have to be a .php extension. For example, http://xenforo.com/community/members.mp3 also works just fine to bring up the Members page.

The problem ChemicalKicks is having with "arcade.php" is just an example of the how XF running on nginx is behaving differently for him versus when he was running Apache but the probem would not be unique to just the arcade (it would affect anything where an explicit request to {whatever}.php was being done and {whatever} was an XF route instead of a physical file).

Compounding the problem, possibly, is that CK is running XenPorta that has its own rewrite at work as well. For example, at 8WayRun.com (the creator of XenPorta) you can go to http://8wayrun.com/ or http://8wayrun.com/portal or http://8wayrun.com/portal.php and all will show the portal page as expected but on CK's site http://the-sps.org/ and http://the-sps.org/portal will work but http://the-sps.org/portal.php results in a blank page.

:X3:
 
[22:19] <Resistance> oh i heard this one before
[22:20] <Resistance> i still dont have a resolution for that though
[22:20] <Resistance> and i think this is why:
[22:20] <Resistance> generally, if the file doesnt exist, then /arcade refers to a folder within the directory structure
[22:20] <Resistance> that is to say, if doc-root is /var/www...
[22:20] <Resistance> then its in /var/www/arcade
[22:21] <Resistance> and arcade probably has its own index page for the arcaed
[22:21] <Resistance> arcade*
[22:21] <Resistance> which is why www.domain.com/arcade works
[22:21] <Resistance> pand not arcade.php
[22:21] <Resistance> (because one's a folder, and the other's a file)
 
Okay NginX abusers - time to get out the text editors as you all likely have to make this change.

This is the current suggested nginx conf as per here

The problem you'll run into with this is that any urls at your site that end with .php will be treated as absolute and xenForo will not internally route the requests, what will happen instead is you'll either get a blank page or a 404.

http://example.com/members.php <----- If you're running NginX and this link doesn't work for you then you need to make the following change.

Find
Code:
location ~ \.php$ {
Directly under it put
Code:
try_files $uri /xf/index.php =404;

So simple, if the location/file ending .php doesn't exists route it back through index.php and ta da xf is now handling php correctly.

The complete copy and paste code is attached.

Code:
location /xf/ {
    try_files $uri $uri/ /xf/index.php?$uri&$args;
    index index.php index.html;
}
 
location /xf/internal_data/ {
    internal;
}
location /xf/library/ {
      internal;
}
 
location ~ \.php$ {
    try_files $uri /xf/index.php =404;
    fastcgi_pass    127.0.0.1:9000;
    fastcgi_param  SCRIPT_FILENAME $document_root$fastcgi_script_name;
    include        fastcgi_params;
}

Remember to change "/xf" to your paths.
 
Top Bottom