Bravo List

Bravo List (http://www.bvlist.com/index.php)
-   Template Shares (http://www.bvlist.com/forumdisplay.php?f=26)
-   -   pls help with Nginx ! (http://www.bvlist.com/showthread.php?t=9050)

Ruffneck 4th April 2013 19:45

pls help with Nginx !
 
hi !

where i must add my .htaccess in nginx.conf file ?

am added

rewrite ^/index.html$ /index.php last;
rewrite ^/(.*)-b-([0-9]+).ts(.*)$ /browse.php?cat=$2 last;
rewrite ^/(.*)-c-([0-9]+).ts(.*)$ /browse.php?browse_categories&category=$2 last;
rewrite ^/(.*)-d-([0-9]+).ts(.*)$ /download.php?id=$2 last;
rewrite ^/(.*)-s-([0-9]+).ts(.*)$ /details.php?id=$2 last;
rewrite ^/(.*)-a-(.*).ts(.*)$ /announce.php?passkey=$2 last;
rewrite ^/(.*)-u?([0-9]+).ts(.*)$ /userdetails.php?id=$2$3 last;
rewrite ^/(.*)-f([0-9]+).tsf(.*)$ /tsf_forums/index.php?fid=$2$3 last;
rewrite ^/(.*)-fd([0-9]+).tsf(.*)$ /tsf_forums/forumdisplay.php?fid=$2$3 last;
rewrite ^/(.*)-t([0-9]+).tsf(.*)$ /tsf_forums/showthread.php?tid=$2$3 last;


but is not work:(

Phogo 5th April 2013 12:01

Could you paste your original .htaccess file for us to have a look at?

Ruffneck 5th April 2013 13:43

TS 5.6 .htaccess

PHP Code:

Options +FollowSymLinks
RewriteEngine On

<Files .htaccess>
    
order allow,deny
    deny from all
</Files>

ErrorDocument 400 /ts_error.php?errorid=400
ErrorDocument 401 
/ts_error.php?errorid=401
ErrorDocument 403 
/ts_error.php?errorid=403
ErrorDocument 404 
/ts_error.php?errorid=404
ErrorDocument 500 
/ts_error.php?errorid=500

# //seo_mod_start
# Uncomment the following and add your tracker path if rewrites arent working properly
#RewriteBase /
RewriteRule ^index.htmlindex.php [L,NE]
RewriteRule ^(.*)-b-([0-9]+).ts(.*)$ browse.php?cat=$[QSA,L]
RewriteRule ^(.*)-c-([0-9]+).ts(.*)$ browse.php?browse_categories&category=$[QSA,L]
RewriteRule ^(.*)-d-([0-9]+).ts(.*)$ download.php?id=$[QSA,L]
RewriteRule ^(.*)-s-([0-9]+).ts(.*)$ details.php?id=$[QSA,L]
RewriteRule ^(.*)-a-(.*).ts(.*)$ announce.php?passkey=$[QSA,L]
RewriteRule ^(.*)-u?([0-9]+).ts(.*)$ userdetails.php?id=$2$[QSA,L]
RewriteRule ^(.*)-f([0-9]+).tsf(.*)$ tsf_forums/index.php?fid=$2$[QSA,L]
RewriteRule ^(.*)-fd([0-9]+).tsf(.*)$ tsf_forums/forumdisplay.php?fid=$2$[QSA,L]
RewriteRule ^(.*)-t([0-9]+).tsf(.*)$ tsf_forums/showthread.php?tid=$2$[QSA,L]
# //seo_mod_end

<IfModule mod_expires>
    <
FilesMatch "\.(gif|jpg|jpeg|png|swf|css|js|html?)$">
        
ExpiresActive On
        ExpiresDefault 
"access plus 10 years"
    
</FilesMatch>
</
IfModule>

<
IfModule mod_headers>
  
Header unset Last-Modified
</IfModule>

FileETag none
php_flag short_open_tag on
php_flag register_globals off 

my nginx.conf file

PHP Code:

worker_processes  1;

error_log  logs/error.log;
pid        logs/nginx.pid;


events {
    
worker_connections  1024;
}


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

    
access_log  logs/access.log;

    
sendfile        on;
    
#tcp_nopush     on;

    #keepalive_timeout  0;
    
keepalive_timeout  65;
        
ssl_session_timeout 10m;
        
ssl_protocols TLSv1.2 TLSv1.1 TLSv1 SSLv3;
        
ssl_ciphers ECDHE-RSA-AES128-SHA256:AES128-GCM-SHA256:RC4:HIGH:!MD5:!aNULL:!EDH
        
ssl_prefer_server_ciphers on;
    
gzip  on;
    
# http server
server {
    
listen 80# IPv4
    
server_name localhost;

    
## Parameterization using hostname of access and log filenames.
    
access_log logs/localhost_access.log;
    
error_log logs/localhost_error.log;

    
## Root and index files.
    
root html;
    
index  index.php index.html index.htm;

    
## If no favicon exists return a 204 (no content error).
    
location = /favicon.ico {
        
try_files $uri =204;
        
log_not_found off;
        
access_log off;
    }
        
    
## Don't log robots.txt requests.
    
location = /robots.txt {
        
allow all;
        
log_not_found off;
        
access_log off;
    }

    
## Try the requested URI as files before handling it to PHP.
    
location / {

        
## Regular PHP processing.
        
location ~ \.php$ {
            
root           html;
            
try_files  $uri =404;
            
fastcgi_pass   127.0.0.1:9000;
            
fastcgi_index  index.php;
            
fastcgi_param  SCRIPT_FILENAME    $document_root$fastcgi_script_name;
            include        
fastcgi_params;
        }

        
## Static files
        
location ~* \.(?:css|gif|htc|ico|js|jpe?g|png|swf)$ {
            
expires max;
            
log_not_found off;
            
## No need to bleed constant updates. Send the all shebang in one
            ## fell swoop.
            
tcp_nodelay off;
            
## Set the OS file cache.
            
open_file_cache max=1000 inactive=120s;
            
open_file_cache_valid 45s;
            
open_file_cache_min_uses 2;
            
open_file_cache_errors off;
        }

        
## Keep a tab on the 'big' static files.
        
location ~* ^.+\.(?:ogg|pdf|pptx?)$ {
            
expires 30d;
            
## No need to bleed constant updates. Send the all shebang in one
            ## fell swoop.
            
tcp_nodelay off;
        }
        } 
# / location

# end http server

# https server
server {
    
listen 443 ssl;
    
server_name localhost;
    
ssl_certificate      ssl.cert;
    
ssl_certificate_key  ssl.key;

    
## Parameterization using hostname of access and log filenames.
    
access_log logs/localhost_access.log;
    
error_log logs/localhost_error.log;

    
## Root and index files.
    
root html;
    
index  index.php index.html index.htm;

    
## If no favicon exists return a 204 (no content error).
    
location = /favicon.ico {
        
try_files $uri =204;
        
log_not_found off;
        
access_log off;
    }

    
## Don't log robots.txt requests.
    
location = /robots.txt {
        
allow all;
        
log_not_found off;
        
access_log off;
    }

    
## Try the requested URI as files before handling it to PHP.
    
location / {

        
## Regular PHP processing.
        
location ~ \.php$ {
            
root           html;
            
try_files  $uri =404;
            
fastcgi_pass   127.0.0.1:9000;
            
fastcgi_index  index.php;
            
fastcgi_param  SCRIPT_FILENAME    $document_root$fastcgi_script_name;
            include        
fastcgi_params;
        }

        
## Static files are served directly.
        
location ~* \.(?:css|gif|htc|ico|js|jpe?g|png|swf)$ {
            
expires max;
            
log_not_found off;
            
## No need to bleed constant updates. Send the all shebang in one
            ## fell swoop.
            
tcp_nodelay off;
            
## Set the OS file cache.
            
open_file_cache max=1000 inactive=120s;
            
open_file_cache_valid 45s;
            
open_file_cache_min_uses 2;
            
open_file_cache_errors off;
        }

        
## Keep a tab on the 'big' static files.
        
location ~* ^.+\.(?:ogg|pdf|pptx?)$ {
            
expires 30d;
            
## No need to bleed constant updates. Send the all shebang in one
            ## fell swoop.
            
tcp_nodelay off;
        }
        } 
# / location
# end https server



Phogo 6th April 2013 13:35

Hey Ruffneck,

Try this,

Code:

# nginx configuration  error_page 500 /ts_error.php?errorid=500;  error_page 404 /ts_error.php?errorid=404;  error_page 403 /ts_error.php?errorid=403;  location = /index.html {  rewrite ^(.*)$ /index.php break; }  location / {  rewrite ^/(.*)-b-([0-9]+).ts(.*)$ /browse.php?cat=$2 break;  rewrite ^/(.*)-c-([0-9]+).ts(.*)$ /browse.php?browse_categories&category=$2 break;  rewrite ^/(.*)-d-([0-9]+).ts(.*)$ /download.php?id=$2 break;  rewrite ^/(.*)-s-([0-9]+).ts(.*)$ /details.php?id=$2 break;  rewrite ^/(.*)-a-(.*).ts(.*)$ /announce.php?passkey=$2 break;  rewrite ^/(.*)-u?([0-9]+).ts(.*)$ /userdetails.php?id=$2$3 break;  rewrite ^/(.*)-f([0-9]+).tsf(.*)$ /tsf_forums/index.php?fid=$2$3 break;  rewrite ^/(.*)-fd([0-9]+).tsf(.*)$ /tsf_forums/forumdisplay.php?fid=$2$3 break;  rewrite ^/(.*)-t([0-9]+).tsf(.*)$ /tsf_forums/showthread.php?tid=$2$3 break; }  location /.htaccess {  deny all; }

Ruffneck 16th April 2013 00:59

is not worked !

i see this in my browser :

Code:

$_COOKIE)) { $_COOKIE = strip_magic_quotes ($_COOKIE); } } if ((!isset ($HTTP_POST_VARS) AND isset ($_POST))) { $HTTP_POST_VARS = $_POST; $HTTP_GET_VARS = $_GET; $HTTP_SERVER_VARS = $_SERVER; $HTTP_COOKIE_VARS = $_COOKIE; $HTTP_ENV_VARS = $_ENV; $HTTP_POST_FILES = $_FILES; } if (!@get_magic_quotes_gpc ()) { if (is_array ($HTTP_GET_VARS)) { while (list ($k, $v) = each ($HTTP_GET_VARS)) { if (is_array ($HTTP_GET_VARS[$k])) { while (list ($k2, $v2) = each ($HTTP_GET_VARS[$k])) { $HTTP_GET_VARS[$k][$k2] = addslashes ($v2); } @reset ($HTTP_GET_VARS[$k]); continue; } else { $HTTP_GET_VARS[$k] = addslashes ($v); continue; } } @reset ($HTTP_GET_VARS); } if (is_array ($HTTP_POST_VARS)) { while (list ($k, $v) = each ($HTTP_POST_VARS)) { if (is_array ($HTTP_POST_VARS[$k])) { while (list ($k2, $v2) = each ($HTTP_POST_VARS[$k])) { $HTTP_POST_VARS[$k][$k2] = addslashes ($v2); } @reset ($HTTP_POST_VARS[$k]); continue; } else { $HTTP_POST_VARS[$k] = addslashes ($v); continue; } } @reset ($HTTP_POST_VARS); } if (is_array ($HTTP_COOKIE_VARS)) { while (list ($k, $v) = each ($HTTP_COOKIE_VARS)) { if (is_array ($HTTP_COOKIE_VARS[$k])) { while (list ($k2, $v2) = each ($HTTP_COOKIE_VARS[$k])) { $HTTP_COOKIE_VARS[$k][$k2] = addslashes ($v2); } @reset ($HTTP_COOKIE_VARS[$k]); continue; } else { $HTTP_COOKIE_VARS[$k] = addslashes ($v); continue; } } @reset ($HTTP_COOKIE_VARS); } } ?>
Fatal error: Call to undefined function gzip() in C:\web\browse.php on line 18

Bump: short_open_tag = on
register_globals = off

am added this settings in php.ini and worked ! is correct ?

but ts_seo is not worked !:)


All times are GMT +2. The time now is 21:23.

Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2024, vBulletin Solutions Inc.