Status
Not open for further replies.

MediaStar

Active Member
2,664
2010
446
235
Hello Wj fellow, im install nginx on windows and php enabled.

But the problem now is im stuck with my current htaccess, can help me rewrite rule my htaccess working with nginx?

This is my htaccess


Code:
<IfModule mod_rewrite.c>RewriteEngine On
RewriteRule ^embed/pt\-(\w+)$ /stream/pyd_to.php?link=$1 [L]
RewriteRule ^embed/gd\-([\-\w]+)$ /stream/g_doc.php?link=$1 [L]
RewriteRule ^embed/vk\-([\|\w]+)$ /stream/vk_com.php?link=$1 [L]
RewriteRule ^embed/p4\-(.*)$ /stream/p44_net.php?link=$1 [L]
RewriteRule ^embed/v4\-(.*)$ /stream/v44_net.php?link=$1 [L]
RewriteRule ^embed/vf\-(.*)$ /stream/vf_me.php?link=$1 [L]
RewriteRule ^embed/(\w+)$ /stream/index.php?link=$1 [L]
RewriteRule ^jwplayer/(.*) /stream/jwplayer/$1 [L]
RewriteRule ^hosts.js$ /stream/hosts.js [L]


RewriteCond %{HTTP_REFERER} !^http://(play\\.)?uniquestream\\.net [NC]
RewriteRule \\.(mp4)$ - [NC,F]
</IfModule>

and this is my nginx.conf

Code:
#user  nobody;
worker_processes  1;


#error_log  logs/error.log;
#error_log  logs/error.log  notice;
#error_log  logs/error.log  info;


#pid        logs/nginx.pid;




events {
    worker_connections  1024;
}




http {
    include       mime.types;
    default_type  application/octet-stream;


    #log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
    #                  '$status $body_bytes_sent "$http_referer" '
    #                  '"$http_user_agent" "$http_x_forwarded_for"';


    #access_log  logs/access.log  main;


    sendfile        on;
    #tcp_nopush     on;


    #keepalive_timeout  0;
    keepalive_timeout  65;


    #gzip  on;


    server {
        listen       80;
        server_name  localhost;


        #charset koi8-r;


        #access_log  logs/host.access.log  main;


        location / {
            root   html;
            index  index.html index.htm index.php;
        }


        #error_page  404              /404.html;


        # redirect server error pages to the static page /50x.html
        #
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }


        # proxy the PHP scripts to Apache listening on 127.0.0.1:80
        #
        #location ~ \.php$ {
        #    proxy_pass   http://127.0.0.1;
        #}


        # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
        #
        location ~ \.php$ {
            root           html;
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_index  index.php;
            fastcgi_param  SCRIPT_FILENAME  C:/nginx/html/$fastcgi_script_name;
            include        fastcgi_params;
        }


        # deny access to .htaccess files, if Apache's document root
        # concurs with nginx's one
        #
        #location ~ /\.ht {
        #    deny  all;
        #}
    }


    # another virtual host using mix of IP-, name-, and port-based configuration
    #
    #server {
    #    listen       8000;
    #    listen       somename:8080;
    #    server_name  somename  alias  another.alias;


    #    location / {
    #        root   html;
    #        index  index.html index.htm;
    #    }
    #}




    # HTTPS server
    #
    #server {
    #    listen       443 ssl;
    #    server_name  localhost;


    #    ssl_certificate      cert.pem;
    #    ssl_certificate_key  cert.key;


    #    ssl_session_cache    shared:SSL:1m;
    #    ssl_session_timeout  5m;


    #    ssl_ciphers  HIGH:!aNULL:!MD5;
    #    ssl_prefer_server_ciphers  on;


    #    location / {
    #        root   html;
    #        index  index.html index.htm;
    #    }
    #}


}

Thanks :sun:
 
Last edited:
22 comments
from what i understand and from what i have read the output of the converter needs to go into nginx.conf, i dont think .htaccess is used at all.
 
I'm no htaccess expert, but using the website mentioned above i got this

Backup your old Nginx config and then replace with this :
http://pastebin.com/raw.php?i=FpusZmDG

Let me know how it goes.

ON0SNSJ.png


and its download the file if you go to this link Watch & Stream Gundam Build Fighters Episode 13 - Battle Weapon - Online | UniqueStream

it should play the video, not downloading the file :)
 
add the following code to you site nginx vhost and restart nginx:

Code:
location /embed {
  rewrite ^/embed/pt\-(\w+)$ /stream/pyd_to.php?link=$1 break;
  rewrite ^/embed/gd\-([\-\w]+)$ /stream/g_doc.php?link=$1 break;
  rewrite ^/embed/vk\-([\|\w]+)$ /stream/vk_com.php?link=$1 break;
  rewrite ^/embed/p4\-(.*)$ /stream/p44_net.php?link=$1 break;
  rewrite ^/embed/v4\-(.*)$ /stream/v44_net.php?link=$1 break;
  rewrite ^/embed/vf\-(.*)$ /stream/vf_me.php?link=$1 break;
  rewrite ^/embed/(\w+)$ /stream/index.php?link=$1 break;
}

location /jwplayer {
  rewrite ^/jwplayer/(.*) /stream/jwplayer/$1 break;
}

location = /hosts.js {
  rewrite ^(.*)$ /stream/hosts.js break;
}

location / {
  if ($http_referer !~ "^http://(play\\.)?uniquestream\\.net"){
    return 403;
  }
 
add the following code to you site nginx vhost and restart nginx:

Code:
location /embed {
  rewrite ^/embed/pt\-(\w+)$ /stream/pyd_to.php?link=$1 break;
  rewrite ^/embed/gd\-([\-\w]+)$ /stream/g_doc.php?link=$1 break;
  rewrite ^/embed/vk\-([\|\w]+)$ /stream/vk_com.php?link=$1 break;
  rewrite ^/embed/p4\-(.*)$ /stream/p44_net.php?link=$1 break;
  rewrite ^/embed/v4\-(.*)$ /stream/v44_net.php?link=$1 break;
  rewrite ^/embed/vf\-(.*)$ /stream/vf_me.php?link=$1 break;
  rewrite ^/embed/(\w+)$ /stream/index.php?link=$1 break;
}

location /jwplayer {
  rewrite ^/jwplayer/(.*) /stream/jwplayer/$1 break;
}

location = /hosts.js {
  rewrite ^(.*)$ /stream/hosts.js break;
}

location / {
  if ($http_referer !~ "^http://(play\\.)?uniquestream\\.net"){
    return 403;
  }


should i keep my previous file or edited file by serverpolice and add this code?

Content type set to octet/stream ?

yep default setting that part
 
try commenting out the octet/stream for once and try,

Also check if its mentioned in any of the nginx conf files.
 
Well it would stream only if a compatible player is found,

Are you using jwplayer or any other player or just depending your luck if the visitor will have VNC installed.
 
Yes, that is true.

Well i cant divulge the config to you as that is our trade secret.

But if you learn nginx and read about a few mods, you'll be able to pull it off.

Peace out X
 
You should focus on one thing, localhost configuration or the uniquestream.net configuration because every one have it is own config.
But any way you should open the nginx.conf and add these lines after:
Code:
location ~ \.php$ {
            root           html;
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_index  index.php;
            fastcgi_param  SCRIPT_FILENAME  C:/nginx/html/$fastcgi_script_name;
            include        fastcgi_params;
        }

Here is the lines:
Code:
location /embed {
	  rewrite ^/embed/pt\-(\w+)$ /stream/pyd_to.php?link=$1 break;
	  rewrite ^/embed/gd\-([\-\w]+)$ /stream/g_doc.php?link=$1 break;
	  rewrite ^/embed/vk\-([\|\w]+)$ /stream/vk_com.php?link=$1 break;
	  rewrite ^/embed/p4\-(.*)$ /stream/p44_net.php?link=$1 break;
	  rewrite ^/embed/v4\-(.*)$ /stream/v44_net.php?link=$1 break;
	  rewrite ^/embed/vf\-(.*)$ /stream/vf_me.php?link=$1 break;
	  rewrite ^/embed/(\w+)$ /stream/index.php?link=$1 break;
	}

	location /jwplayer {
	  rewrite ^/jwplayer/(.*) /stream/jwplayer/$1 break;
	}

	location = /hosts.js {
	  rewrite ^(.*)$ /stream/hosts.js break;
	}

	location / {
	  if ($http_referer !~ "^http://(play\\.)?uniquestream\\.net"){
		return 403;
   }
 
Status
Not open for further replies.
Back
Top