A Script Pro nginx url Rewrite rule fails to play MP4 workaround

Source: Internet
Author: User

I am using nginx and I have already add the line

    Location/file/ {        ^/file/([0-9]+)/([0-9]+)/([ ^/]*)/([0-9]+)/(. *) $/file. php? ID=$1&server=$2&hash=$3&expire=$4&  File=$5last;    }

In the conf file of the domain.

But the videos does not play.

I have a try copy the parameters from the link to something like

http://www.mydomain.com/file.php?id=1&server=0&hash=796609733f08c4bb8b89&expire= 1464380369&file=mp4/1.mp4

And I can see the mp4 file playing if I put the URL directly on the browser.

Yet it would return 403 if I put the follow directly on the browser.

http://www.mydomain.com/file/1/0/796609733f08c4bb8b89/1464380369/mp4/1.mp4

 

So I suppose it was the problem of rewrite but I am not being able to figure out the causes.

How can I fix this problem?

OK, eventually I has figured it out.

We have the use

    Location ^~/file/ {        ^/file/([0-9]+)/([0-9]+)/ ([^/]*)/([0-9]+)/(. *) $/file. php? ID=$1&server=$2&hash=$3&expire=$4&  File=$5last;    }

Instead of

    location/file/{...}. ...}

Otherwise it'll keep searching for expressions and

Location ~ \.mp4 {.........}

Which appears later would override the search for/file/, because apparently there would be a ". mp4" at the end Of/file/ur L.

I suggest symtab to change the instruction in the script zip file.

 http://forum.adultscriptpro.com/viewtopic.php?id=3627

A Script Pro nginx url Rewrite rule fails to play MP4 workaround

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.