jVA 404 Error on Score Submission

More
6 years 11 months ago #38221 by pgkerr
Hayward, could you please try re-arranging your menu. First remove all menu items referring to jVArcade. Then recreate a new menu item on the menu root to the jvarcade home view. I believe the issue is in part due to the directory structure of your server and the menu structure of your site, to help clarify this do you have a folder "games" in your site root directory ?

I ask this as by invoking the system by pocketmortys.net/newscore.php the system plugin redirect functions try to work all be it without parameters.
Trying to invoke the system by pocketmortys.net/games/newscore.php gives us the 404 error.

It seems to me for some reason the jVArcade component looks to be running out of a subdirectory, or at least the urls seem to be acting on that "games" subdirectory therefore the component is not seeing the newscore.php file.

I am unable to determine with out complete admin and ftp access what exactly if going on so the first thing I would try is separate the jVArcade from your other games in the menu first. That will take the "games" out of your jvarcade urls I think

Please Log in or Create an account to join the conversation.

More
6 years 11 months ago #38236 by Hayward

pgkerr wrote: Hayward, could you please try re-arranging your menu. First remove all menu items referring to jVArcade. Then recreate a new menu item on the menu root to the jvarcade home view. I believe the issue is in part due to the directory structure of your server and the menu structure of your site, to help clarify this do you have a folder "games" in your site root directory ?

I ask this as by invoking the system by pocketmortys.net/newscore.php the system plugin redirect functions try to work all be it without parameters.
Trying to invoke the system by pocketmortys.net/games/newscore.php gives us the 404 error.

It seems to me for some reason the jVArcade component looks to be running out of a subdirectory, or at least the urls seem to be acting on that "games" subdirectory therefore the component is not seeing the newscore.php file.

I am unable to determine with out complete admin and ftp access what exactly if going on so the first thing I would try is separate the jVArcade from your other games in the menu first. That will take the "games" out of your jvarcade urls I think


There's no folder in the root directory called "games," however I had used that alias as a menu item for the Memorizr component parent menu. Previously the jArcade menu item was under this parent "games" menu item.

I've removed all jArcade menu items, and created a new one under the root here: pocketmortys.net/blips-and-chitz

I am still having the error on score submission, only this time from pocketmortys.net/blips-and-chitz/newscore.php

I'd be more than happy to let you take a look at the files if you're willing. Thanks!

Please Log in or Create an account to join the conversation.

More
6 years 11 months ago #38246 by pgkerr
Please create a Joomla admin account and email me the details along with ftp details to pete dot kerr at bigpond dot com. I'll have a look and see what I can figure out.

Please Log in or Create an account to join the conversation.

More
6 years 11 months ago - 6 years 11 months ago #38280 by pgkerr
Hi Hayward, I never recievced an email so not sure if you sent one or not. I have been doing some research and came across something interesting, I noted your server is using nginx and found the following on their website:

Uncontrolled requests to PHP

I have particular interest in the try_files directive, As mentioned previously I can invoke the system by aiming at the domina.com/newcsore.php file and your server responds, But when trying with any other path ie: domain.com/games/blipsetc/game/newscore.php the plugin is not fired. On my server and I image all others that the arcade works on ANY url passed to the server ending in newscore.php should invoke the system plugin.

When reading the info in the link posted it is possible that your server is simply stopping the process due to the fact that domain.com/games/blipsetc/game/newscore.php is not a literal/actual file so your server doesn't pass it onto the PHP and then follows its directive on what to do if a file doesn't exist which in your case may be set to =404.

If you have access to config files it may be worth looking for any nginx and php.ini settings like whats mentioned. I'm going to see if I can get an nginx server setup locally for testing purposes.

Regards Pete
Last edit: 6 years 11 months ago by pgkerr.

Please Log in or Create an account to join the conversation.

More
6 years 11 months ago #38301 by pgkerr
I have managed to reproduce this issue using nginx and now have jVAcrade running correctly on my nginx test server

The issue:
nginx is written to avoid any overheads where possible, therefore it runs checks to see if a .php file actually exists on disk before passing it to the php engine for processing. Default for a file that does not exist is obviously to return a 404 File not found error. Due to Joomla creating what I call dynamic urls depending on menu item names etc when SEF and Rewrite are enabled in global configuration the urls don't always relate to an actual file path or file, for example http://localhost/games/game/newscore.php does not exist the so the request is not passed to php and a 404 error is return to the client.

The Fix:
nginx requires extra directives in the nginx.conf file as follows;

Add rewrite rule for gamedata folder into the existing block for location /
Code:
location / { #Rewrite rule for V32 games using /arcade/gamedata folders. rewrite ^/.*/arcade/gamedata/(.*)$ /arcade/gamedata/$1; }

Add new location blocks below the block for location / Note you may have to replace http://127.0.0.1 with your servers IP
Code:
#Proxy's used to avoid 404 errors for files that dont exist on disk and trigger the system plugin. location ~ game/newscore.php$ { set $file /newscore.php; proxy_method POST; proxy_pass_request_headers on; proxy_pass_request_body on; proxy_pass http://127.0.0.1$file; } location ~ game/index.php { set $req /index.php?$args; proxy_method POST; proxy_pass_request_headers on; proxy_pass_request_body on; proxy_pass http://127.0.0.1$req; } location ~ game/arcade.php$ { set $file /arcade.php; proxy_method POST; proxy_pass_request_headers on; proxy_pass_request_body on; proxy_pass http://127.0.0.1$file; }

I have attached my nginx.conf in txt file for clarity, obviously yours may be alot larger. Unfortunately if you don't have access to the configuration files or your host is not willing to add these extra directives your out of luck.

File Attachment:

File Name: nginx.conf.txt
File Size:4 KB
Attachments:

Please Log in or Create an account to join the conversation.

More
6 years 4 months ago #40250 by pgkerr
Latest version of jVArcade and support now available from jvarcade.com

Please Log in or Create an account to join the conversation.

Time to create page: 0.338 seconds
Powered by Kunena Forum
Disclaimer: Nordmograph is not affiliated with or endorsed by The Joomla! Project™. Any products and services provided through this site are not supported or warrantied by The Joomla! Project or Open Source Matters, Inc. Use of the Joomla!® name, symbol, logo and related trademarks is permitted under a limited license granted by Open Source Matters, Inc.