Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

On a Guruplug (ARM) running Squeeze (upgraded from Lenny) I have an odd issue I never came along before.

Requesting a directory without trailing slash rewrites the url to the default server_name

This is my server_name:

server_name 10.10.10.1 192.168.*.* sheeva.domain.tld sheeva localhost;

Whenever I access 192.168.1.15/mrtg I get redirected to 10.10.10.1/mrtg/ which, depending on the interface, doesn't always work out as it should be (IP being unaccessible).

$ wget http://192.168.1.15/mrtg -O /dev/null 
--2011-02-09 22:17:51--  http://192.168.1.15/mrtg
Connecting to 192.168.1.15:80... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: http://10.10.10.1/mrtg/ [following]
--2011-02-09 22:17:51--  http://10.10.10.1/mrtg/
Connecting to 10.10.10.1:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 3742 (3.7K) [text/html]
Saving to: `/dev/null'

I don't seem to have this issue on other nginx servers. I've checked config files for differences but can't find any.

# nginx -v
nginx version: nginx/0.7.67

Thanks

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

Sounds like you need to set server_name_in_redirect to off.

share|improve this answer
    
Correct, thanks! –  Tuinslak Feb 10 '11 at 9:55
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.