Weird issue with relative links

Hi,

I am fairly new to nginx but appear to have it working well… along
with php-fpm.

Working on a PHP script that uses slash arguments I’m hitting an odd
problem.

I am able to retrieve the argument correctly and this works fine in the
script. Where my issue lies is with the links that are then displayed.

The script is at:
http://alpha.serverb.co.uk/debian/parser.php/gns-3

The filelist links on the page should are all relative. Testing on my
local Apache server, this works perfectly. The links are like this:

http://webdev.internal.serverb.co.uk/debian/parser.php/gns-3/GNS3-0.8.7-src.zip

This is correct… the link includes the php script, slash argument and
the file name.

Now on nginx… it is returned different… the links are missing the
first slash argument so appear as:

http://alpha.serverb.co.uk/debian/parser.php/GNS3-0.8.7-src.zip

I have checked the values set by fastcgi, and these all appear to match
what Apache returns… so I’m stumped!

I know I can get around this by changing the links… but that isn’t an
option as the page is later parsed by other scripts and should be
backwards compatible with the previous version.

Any help would be most welcome

Regards

Daniel Lintott

On Tue, Jul 08, 2014 at 12:09:57PM +0100, Daniel Lintott wrote:

Hi there,

The script is at:
http://alpha.serverb.co.uk/debian/parser.php/gns-3

http://alpha.serverb.co.uk/debian/parser.php/gns-3 and
http://alpha.serverb.co.uk/debian/parser.php/gns-3/ are different urls,
especially when it comes to resolving relative links.

What is the response you get to a “curl -v” request for the nginx url
and the equivalent apache url?

I suspect that your apache is configured to issue a redirect and your
nginx is not.

Copy-paste the first 20 lines of the responses, if the fix is not clear.

f

Francis D. [email protected]

On 08/07/14 12:36, Francis D. wrote:

What is the response you get to a “curl -v” request for the nginx url
and the equivalent apache url?

I suspect that your apache is configured to issue a redirect and your
nginx is not.

Copy-paste the first 20 lines of the responses, if the fix is not clear.

f

Hmmm… now I’ve confused myself! Both are now returning the same…
minus the slash argument!

Seems like it may have been my error in copying the files to the
server… A classic case of PEBKAC!

Daniel

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs