Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

with the following rules, php can't make a redirect to another file. it's freezes at the point when it gets toheader("Content-type: video/x-flv"); header("Location:" . $VIDEO); or could be get_headers(); on my php script.

my iptables:

 iptables -L
Chain INPUT (policy ACCEPT)
target     prot opt source               destination         
ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:22151 
ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:http 
ACCEPT     all  --  anywhere             anywhere            
ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:webcache 
ACCEPT     tcp  --  anywhere             anywhere            tcp spt:webcache 
ACCEPT     tcp  --  anywhere             anywhere            tcp spt:http 
DROP       all  --  anywhere             anywhere            

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination         

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination     

what i've tried

iptables -A INPUT -p ICMP --icmp-type 8 -j ACCEPT

as soon as i remove the DROP all -- anywhere anywhere everything works fine.

share|improve this question
    
PHP nothing to do with iptables... and iptables does not look at the contents of an http session. I think you're grasping at things that don't exist. –  TheCompWiz Apr 10 '13 at 20:51
add comment

1 Answer

HTTP redirects don't use ICMP packets; your problem appears instead to be a missing space in the second header() call. Try header("Location: " . $VIDEO) instead.

share|improve this answer
    
no, it's working when i remove iptables -A INPUT -p ICMP --icmp-type 8 -j ACCEPT –  teslasimus Apr 10 '13 at 20:53
    
That makes absolutely no sense. –  Aaron Miller Apr 10 '13 at 20:55
    
its a fact. as soon as i add the rules i can't play videos, when i drop the rule everything is working. –  teslasimus Apr 10 '13 at 20:58
    
or could be it stops at get_headers(); –  teslasimus Apr 10 '13 at 20:59
    
I think I misread your original post; if the videos start working when you remove the DROP rule, then presumably there's something about the post-redirect incoming connection that it can't handle. What exactly does $VIDEO contain at the point in your script where it's used in the header() call? –  Aaron Miller Apr 10 '13 at 21:37
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.