Welcome! Log In Create A New Profile

Advanced

Internal URL handling

Posted by ChemicalKicks 
Internal URL handling
December 29, 2011 02:17PM
I have this odd issue.

I have a forum installed at www.the-sps.org, I also have an arcade installed at www.the-sps.org/arcade

Now basically I've run into a problem where my arcade scores won't save, this is happening because the games are attempting to pass the score via www.the-sps.org/arcade.php but getting a 404. When I was running Apache this worked just fine.

I've asked for help here http://xenforo.com/community/threads/arcade-works-arcade-php-nope.25052 if it helps?

This is my current conf.

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 /srv/www/the-sps.org/logs/access.log;
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;
}
}
Re: Internal URL handling
January 02, 2012 07:04PM
Here's a bit of extra sauce if it helps to fully understand the issue.

"Kevin from XenForo.com" - 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.

Works: http://xenforo.com/community/members
Works: http://xenforo.com/community/members.php
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.

Works: http://www.rocketslice.com/community/members
Does Not Work: http://www.rocketslice.com/community/members.php
Works: http://the-sps.org/members
Does Not Work: http://the-sps.org/members.php
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.
Re: Internal URL handling
January 04, 2012 06:21AM
I've just noticed something.

Route handling seems to work with any other file extension just not .php

For example
http://the-sps.org/arcade.mp3 works you can actually add any extension you like and it'll work
http://the-sps.org/arcade.php doesn't
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 275
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready