⏩ OldSchoolKO ✅ | " VALHALLA " 2.000.000 TL ÖDÜL ⭐ 3 YIL ARADAN SONRA ✅ v.1098 MYKO EFSANESİ ⚔ OFFICIAL 17.05.2024 - 21:00 ⏪
Cuceko

Nginx Sistemi ile Kopanelinizi Çalıştırın ve Sunucuzu rahatlatın (KO-FOX Farkıyla)

  •         

            

            

            

            

  • HyperFilter | DoS Protection | DDoS Protection | DoS Mitigation | DDoS Mitigation | AntiDoS | AntiDDoS | Proxy Shielding
E Çevrimdışı
11 Ocak 2012
12,856
108
63
Cevap: Nginx Sistemi ile Kopanelinizi Çalıştırın ve Sunucuzu rahatlatın (KO-FOX Farkıyla)



Netframework 4,0 veya üstünü yükleyin hata düzelir..
 
E Çevrimdışı
11 Ocak 2012
12,856
108
63
Cevap: Nginx Sistemi ile Kopanelinizi Çalıştırın ve Sunucuzu rahatlatın (KO-FOX Farkıyla)



Nginx Sisteminin nasıl bir mantıgının oldugunu bılselerdı arkadaslar , emınım sana bu konun için borçlu kalacaklardı . paylasım ıcın tskler yararlı olması dilegiyle.
 
E Çevrimdışı
11 Ocak 2012
12,856
108
63
Cevap: Nginx Sistemi ile Kopanelinizi Çalıştırın ve Sunucuzu rahatlatın (KO-FOX Farkıyla)



Nginx Sisteminin nasıl bir mantıgının oldugunu bılselerdı arkadaslar , emınım sana bu konun için borçlu kalacaklardı . paylasım ıcın tskler yararlı olması dilegiyle.



Zamanla onuda öğrenirler inşallah
 
B Çevrimdışı

bilisimtitan

Kayıtlı Üye
1 Nisan 2013
231
0
16
34
.htacces ile İlgili bulabildigim tek türkçe konu :)

NGinx .htaccess Olayı - Google Fan Webmaster Forum



burdaki gibi yaptım fakat olmadı biri yardımcı olabilirmi acaba. ben beceremedim 2 gundur.



orjinal .hfacces

Options +FollowSymLinks

RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule ^login$ index.php?pages=login [L,NC]

RewriteRule ^logout$ index.php?pages=logout [L,NC]

RewriteRule ^usercp$ index.php?pages=usercp [L,NC]

RewriteRule ^usercp-2$ index.php?pages=usercp&islem=2 [L,NC]

RewriteRule ^tumduyurular$ index.php?pages=allnews [L,NC]

RewriteRule ^forgotpassword$ index.php?pages=forgotpassword [L,NC]

RewriteRule ^forgotpassword-2$ index.php?pages=forgotpassword&islem=2 [L,NC]

RewriteRule ^forgotpassword-3$ index.php?pages=forgotpassword&islem=3 [L,NC]

RewriteRule ^register$ index.php?pages=register [L,NC]

RewriteRule ^register-2$ index.php?pages=register&islem=2 [L,NC]

RewriteRule ^news/(.*?)/(.*?)$ index.php?pages=news&id=$1 [L,NC]

RewriteRule ^clandetail/(.*?)$ index.php?pages=clandetail&id=$1 [L,NC]

RewriteRule ^manner$ index.php?pages=manner [L,NC]

RewriteRule ^kutulu$ index.php?pages=kutulu [L,NC]

RewriteRule ^krowaz$ krowaz [L,NC]

RewriteRule ^detaylar$ detaylar [L,NC]

RewriteRule ^kutusuz$ index.php?pages=kutusuz [L,NC]

RewriteRule ^deathlog$ index.php?pages=deathlog [L,NC]

RewriteRule ^puslog$ index.php?pages=puslog [L,NC]

RewriteRule ^onlinelist$ index.php?pages=onlinelist [L,NC]

RewriteRule ^userlist$ index.php?pages=userlist [L,NC]

RewriteRule ^clanlist$ index.php?pages=clanlist [L,NC]

RewriteRule ^nationcomparison$ index.php?pages=nationcomparison [L,NC]

RewriteRule ^banlist$ index.php?pages=banlist [L,NC]

RewriteRule ^download$ index.php?pages=download [L,NC]

RewriteRule ^gamemasters$ index.php?pages=gamemasters [L,NC]

RewriteRule ^BorderDefanceWar$ index.php?pages=BorderDefanceWar [L,NC]

RewriteRule ^JuraidMountain$ index.php?pages=JuraidMountain [L,NC]

RewriteRule ^LunarWar$ index.php?pages=LunarWar [L,NC]

RewriteRule ^DelosWar$ index.php?pages=DelosWar [L,NC]

RewriteRule ^vote/(.*?)$ index.php?pages=vote&id=$1 [L,NC]

RewriteRule ^votes/(.*?)$ index.php?pages=votes&id=$1 [L,NC]

RewriteRule ^usercp/editprofile$ index.php?pages=usercp&act=editprofile [L,NC]

RewriteRule ^usercp/mytickets$ index.php?pages=usercp&act=mytickets [L,NC]

RewriteRule ^usercp/mytickets/newticket$ index.php?pages=usercp&act=mytickets&i=newticket [L,NC]

RewriteRule ^usercp/mytickets/ticket/(.*?)$ index.php?pages=usercp&act=mytickets&i=ticket&id=$1 [L,NC]

RewriteRule ^usercp/uploadkesn$ index.php?pages=usercp&act=uploadkesn [L,NC]

RewriteRule ^usercp/pus$ index.php?pages=usercp&act=pus [L,NC]

RewriteRule ^usercp/pus/ncs$ index.php?pages=usercp&act=pus&i=ncs [L,NC]

RewriteRule ^usercp/pus/nts$ index.php?pages=usercp&act=pus&i=nts [L,NC]

RewriteRule ^usercp/pus/job$ index.php?pages=usercp&act=pus&i=job [L,NC]

RewriteRule ^usercp/pus/market$ index.php?pages=usercp&act=pus&i=market [L,NC]

RewriteRule ^usercp/pus/market/items$ index.php?pages=usercp&act=pus&i=market&getMarket=items [L,NC]

RewriteRule ^usercp/pus/market/premium$ index.php?pages=usercp&act=pus&i=market&getMarket=premium [L,NC]

RewriteRule ^usercp/pus/market/items/(.*?)$ index.php?pages=usercp&act=pus&i=market&getMarket=items&pus_islem=satinal&id=$1 [L,NC]

RewriteRule ^usercp/pus/market/premium/(.*?)$ index.php?pages=usercp&act=pus&i=market&getMarket=premium&pus_islem=satinal&id=$1 [L,NC]

RewriteRule ^usercp/paymentnotice$ index.php?pages=usercp&act=paymentnotice [L,NC]

RewriteRule ^usercp/codehistory$ index.php?pages=usercp&act=codehistory [L,NC]

RewriteRule ^usercp/buycredit$ index.php?pages=usercp&act=buycredit [L,NC]

RewriteRule ^usercp/buycredit/product/(.*?)$ index.php?pages=usercp&act=buycredit&islem=product&id=$1 [L,NC]

RewriteRule ^usercp/buycredit/addtocart/(.*?)$ index.php?pages=usercp&act=buycredit&islem=addtocart&id=$1 [L,NC]

RewriteRule ^usercp/myorders$ index.php?pages=usercp&act=myorders [L,NC]

RewriteRule ^usercp/banks$ index.php?pages=usercp&act=banks [L,NC]

RewriteRule ^turkish$ ?dil=tr [L,NC]

RewriteRule ^english$ ?dil=en [L,NC]



Bunu Convert apache htaccess nginx rewrite bu siteden değiştirdim

bu şekilde oldu

if (!-f $request_filename){

set $rule_0 1$rule_0;

}

if (!-d $request_filename){

set $rule_0 2$rule_0;

}

if ($rule_0 = "21"){

rewrite ^/login$ /index.php?pages=login last;

}

rewrite ^/logout$ /index.php?pages=logout last;

rewrite ^/usercp$ /index.php?pages=usercp last;

rewrite ^/usercp-2$ /index.php?pages=usercp&islem=2 last;

rewrite ^/tumduyurular$ /index.php?pages=allnews last;

rewrite ^/forgotpassword$ /index.php?pages=forgotpassword last;

rewrite ^/forgotpassword-2$ /index.php?pages=forgotpassword&islem=2 last;

rewrite ^/forgotpassword-3$ /index.php?pages=forgotpassword&islem=3 last;

rewrite ^/register$ /index.php?pages=register last;

rewrite ^/register-2$ /index.php?pages=register&islem=2 last;

rewrite ^/news/(.*?)/(.*?)$ /index.php?pages=news&id=$1 last;

rewrite ^/clandetail/(.*?)$ /index.php?pages=clandetail&id=$1 last;

rewrite ^/manner$ /index.php?pages=manner last;

rewrite ^/kutulu$ /index.php?pages=kutulu last;

rewrite ^/kutusuz$ /index.php?pages=kutusuz last;

rewrite ^/deathlog$ /index.php?pages=deathlog last;

rewrite ^/onlinelist$ /index.php?pages=onlinelist last;

rewrite ^/userlist$ /index.php?pages=userlist last;

rewrite ^/clanlist$ /index.php?pages=clanlist last;

rewrite ^/nationcomparison$ /index.php?pages=nationcomparison last;

rewrite ^/banlist$ /index.php?pages=banlist last;

rewrite ^/download$ /index.php?pages=download last;

rewrite ^/gamemasters$ /index.php?pages=gamemasters last;

rewrite ^/BorderDefanceWar$ /index.php?pages=BorderDefanceWar last;

rewrite ^/JuraidMountain$ /index.php?pages=JuraidMountain last;

rewrite ^/LunarWar$ /index.php?pages=LunarWar last;

rewrite ^/DelosWar$ /index.php?pages=DelosWar last;

rewrite ^/vote/(.*?)$ /index.php?pages=vote&id=$1 last;

rewrite ^/votes/(.*?)$ /index.php?pages=votes&id=$1 last;

rewrite ^/usercp/editprofile$ /index.php?pages=usercp&act=editprofile last;

rewrite ^/usercp/mytickets$ /index.php?pages=usercp&act=mytickets last;

rewrite ^/usercp/mytickets/newticket$ /index.php?pages=usercp&act=mytickets&i=newticket last;

rewrite ^/usercp/mytickets/ticket/(.*?)$ /index.php?pages=usercp&act=mytickets&i=ticket&id=$1 last;

rewrite ^/usercp/uploadkesn$ /index.php?pages=usercp&act=uploadkesn last;

rewrite ^/usercp/pus$ /index.php?pages=usercp&act=pus last;

rewrite ^/usercp/pus/ncs$ /index.php?pages=usercp&act=pus&i=ncs last;

rewrite ^/usercp/pus/nts$ /index.php?pages=usercp&act=pus&i=nts last;

rewrite ^/usercp/pus/job$ /index.php?pages=usercp&act=pus&i=job last;

rewrite ^/usercp/pus/market$ /index.php?pages=usercp&act=pus&i=market last;

rewrite ^/usercp/pus/market/items$ /index.php?pages=usercp&act=pus&i=market&getMarket=items last;

rewrite ^/usercp/pus/market/premium$ /index.php?pages=usercp&act=pus&i=market&getMarket=premium last;

rewrite ^/usercp/pus/market/items/(.*?)$ /index.php?pages=usercp&act=pus&i=market&getMarket=items&pus_islem=satinal&id=$1 last;

rewrite ^/usercp/pus/market/premium/(.*?)$ /index.php?pages=usercp&act=pus&i=market&getMarket=premium&pus_islem=satinal&id=$1 last;

rewrite ^/usercp/paymentnotice$ /index.php?pages=usercp&act=paymentnotice last;

rewrite ^/usercp/codehistory$ /index.php?pages=usercp&act=codehistory last;

rewrite ^/usercp/buycredit$ /index.php?pages=usercp&act=buycredit last;

rewrite ^/usercp/buycredit/product/(.*?)$ /index.php?pages=usercp&act=buycredit&islem=product&id=$1 last;

rewrite ^/usercp/buycredit/addtocart/(.*?)$ /index.php?pages=usercp&act=buycredit&islem=addtocart&id=$1 last;

rewrite ^/usercp/myorders$ /index.php?pages=usercp&act=myorders last;

rewrite ^/usercp/banks$ /index.php?pages=usercp&act=banks last;

rewrite ^/turkish$ /?dil=tr last;

rewrite ^/english$ /?dil=en last;







ama bunları nereye yapıstıracam anlamadım



bura orjinal nginx.conf dosyası

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 ~* ^.+\.(?:eek:gg|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 ~* ^.+\.(?:eek:gg|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

}







bana bi yardımcı olursanız mutlu olurum yapılmıs sekilde verebilirseniz.
 
E Çevrimdışı
11 Ocak 2012
12,856
108
63
Cevap: Re: Nginx Sistemi ile Kopanelinizi Çalıştırın ve Sunucuzu rahatlatın (KO-FOX Farkıyla)



.htacces ile İlgili bulabildigim tek türkçe konu :)

NGinx .htaccess Olayı - Google Fan Webmaster Forum



burdaki gibi yaptım fakat olmadı biri yardımcı olabilirmi acaba. ben beceremedim 2 gundur.



orjinal .hfacces





Bunu Convert apache htaccess nginx rewrite bu siteden değiştirdim

bu şekilde oldu









ama bunları nereye yapıstıracam anlamadım



bura orjinal nginx.conf dosyası









bana bi yardımcı olursanız mutlu olurum yapılmıs sekilde verebilirseniz.



Verdiğin R10 Konusunu iyi incele adam saten nasıl yapacağını tek tek anlatmış :)
 
E Çevrimdışı
11 Ocak 2012
12,856
108
63
Cevap: Nginx Sistemi ile Kopanelinizi Çalıştırın ve Sunucuzu rahatlatın (KO-FOX Farkıyla)



Nginx .htaccess Olayı;



Apache bildiğiniz üzere dokuman root dizinindeki .htaccess dosyasındaki yönergeleri okuyarak işlem yapabilmektedir. fakat diğer web sunucularda (lighttpd, nginx, zeus vb..) şimdilik böyle bir standart düşünülmemektedir.

dolayısı ile nginx in rewrite modulunu ancak config dosyasının içerisinde tanımlamamız gerekmektedir.



Aşağıda örnek bir Nginx.conf dosyası vardır.

worker_processes 1;

events { worker_connections 1024;}

http {

include mime.types;

default_type application/octet-stream;

sendfile on;

keepalive_timeout 65;



server {

listen 80;

server_name domain.com domain.com;



location / {

root html;

index index.html index.htm index.php;

}



location ~ \.php$ {

root html;

fastcgi_pass 127.0.0.1:9000;

fastcgi_index index.php;

fastcgi_param SCRIPT_FILENAME /usr/local/nginx/html$fastcgi_script_name;

include fastcgi_params;

}}



}



burada 2 adet locasyonumuz tanımlıdır. Bunlardan birisi "location ~ \.php$" dir ki bu lokasyon php kurduğumuzda eklemiz geren .php uzantıları çalıştıracak parametrenin bulunduğu kısımdır. diğeri ise "location /" dir yani apachenin "htdocs" u yada "publick_html" sidir.

.htaccess ayarlarımız işde tam bu "location /" de yapıcaz

örnek .htaccess dosyam :

ReWriteRule ^index.html$ index.php [L,NC]

ReWriteRule ^tum-videolar.html$ tumvideolar.php [L,NC]

ReWriteRule ^en-cok-izlenen-videolar.html$ encokizlenen.php [L,NC]

ReWriteRule ^en-cok-izlenen-videolar-sayfa(.*).html$ encokizlenen.php?sayfa=$1 [L,NC]

ReWriteRule ^tum-videolar-sayfa(.*).html$ tumvideolar.php?sayfa=$1 [L,NC]

ReWriteRule ^aranilanlar-sayfa(.*).html$ etiketler.php?sayfa=$1 [L,NC]

RewriteRule ^(.*)-ara-sayfa(.*).html$ arananlar.php?aranan=$1&sayfa=$2

RewriteRule ^(.*)-Sayfa(.*).html$ kategoriler.php?katseolink=$1&sayfa=$2 [L,NC]

ReWriteRule ^iletisim.html$ iletisim.php [L,NC]

ReWriteRule ^arama.html$ arananlar.php [L,NC]

ReWriteRule ^arananlar.html$ etiketler.php [L,NC]

ReWriteRule ^puanver.html$ puanver.php [L,NC]

RewriteRule ^(.*)-izle.html$ videoizle.php?basliktr=$1 [L]

RewriteRule ^(.*)-ara.html$ arananlar.php?etiketaranan=$1 [L,QSA]

RewriteRule ^(.*).html$ kategoriler.php?katseolink=$1 [L]



Nginx de rewrite yazmaya başlarken if koşulunu yazmak mecburiyetindeyiz.

yukarıdaki gördüğünüz .htaccess dosyasından çok farklı ruleset iniz yoksa sizinde yazıcağınız ifade if (!-f $request_filename) olucaktır.

Yani istek gönderilen dosya yoksa sizin belirleyeceğinize rewrite yapsın.




yani kısaca yukarıdaki kodum şu şekilde değişecek :



if (!-f $request_filename) {

rewrite /index.html /index.php last;

rewrite /tum-videolar.html /tumvideolar.php last;

rewrite /en-cok-izlenen-videolar.html /encokizlenen.php last;

rewrite /en-cok-izlenen-videolar-sayfa(.*).html /encokizlenen.php?sayfa=$1 last;

rewrite /tum-videolar-sayfa(.*).html /tumvideolar.php?sayfa=$1 last;

rewrite /aranilanlar-sayfa(.*).html /etiketler.php?sayfa=$1 last;

rewrite /(.*)-ara-sayfa(.*).html /arananlar.php?aranan=$1&sayfa=$2 last;

rewrite /(.*)-Sayfa(.*).html /kategoriler.php?katseolink=$1&sayfa=$2 last;

rewrite /iletisim.html /iletisim.php last;

rewrite /arananlar.html /etiketler.php last;

rewrite /puanver.html /puanver.php last;

rewrite /(.*)-izle.html /videoizle.php?basliktr=$1 last;

rewrite /(.*)-ara.html /arananlar.php?etiketaranan=$1 last;

rewrite /(.*).html /kategoriler.php?katseolink=$1 last;

}



Bunu manuel olarak yapamıyorsanuz, Buyrun .htaccess nginx convert: Convert apache htaccess to nginx



görüldüğü gibi arasında çokda fark yok.Bu oluşturduğunu ruleleri "location /" e ekleyip ngin i restart yaptıkdan sonra artık elveda apache diyebilirsiniz.



worker_processes 1;

events { worker_connections 1024;}

http {

include mime.types;

default_type application/octet-stream;

sendfile on;

keepalive_timeout 65;



server {

listen 80;

server_name www.domain.com domain.com;

access_log logs/host.access.log main;

location / {

root html;

index index.html index.htm index.php;

if (!-f $request_filename) {

rewrite /index.html /index.php last;

rewrite /tum-videolar.html /tumvideolar.php last;

rewrite /en-cok-izlenen-videolar.html /encokizlenen.php last;

rewrite /en-cok-izlenen-videolar-sayfa(.*).html /encokizlenen.php?sayfa=$1 last;

rewrite /tum-videolar-sayfa(.*).html /tumvideolar.php?sayfa=$1 last;

rewrite /aranilanlar-sayfa(.*).html /etiketler.php?sayfa=$1 last;

rewrite /(.*)-ara-sayfa(.*).html /arananlar.php?aranan=$1&sayfa=$2 last;

rewrite /(.*)-Sayfa(.*).html /kategoriler.php?katseolink=$1&sayfa=$2 last;

rewrite /iletisim.html /iletisim.php last;

rewrite /arananlar.html /etiketler.php last;

rewrite /puanver.html /puanver.php last;

rewrite /(.*)-izle.html /videoizle.php?basliktr=$1 last;

rewrite /(.*)-ara.html /arananlar.php?etiketaranan=$1 last;

rewrite /(.*).html /kategoriler.php?katseolink=$1 last;

}

}



location ~ \.php$ {

root html;

fastcgi_pass 127.0.0.1:9000;

fastcgi_index index.php;

fastcgi_param SCRIPT_FILENAME /usr/local/nginx/html$fastcgi_script_name;

include fastcgi_params;

}}



}



Kaynak için: Meksikalı 'ya teşekkürler...
 
B Çevrimdışı

bilisimtitan

Kayıtlı Üye
1 Nisan 2013
231
0
16
34
Re: Cevap: Nginx Sistemi ile Kopanelinizi Çalıştırın ve Sunucuzu rahatlatın (KO-FOX Farkıyla)



Nginx .htaccess Olayı;



Apache bildiğiniz üzere dokuman root dizinindeki .htaccess dosyasındaki yönergeleri okuyarak işlem yapabilmektedir. fakat diğer web sunucularda (lighttpd, nginx, zeus vb..) şimdilik böyle bir standart düşünülmemektedir.

dolayısı ile nginx in rewrite modulunu ancak config dosyasının içerisinde tanımlamamız gerekmektedir.



Aşağıda örnek bir Nginx.conf dosyası vardır.





burada 2 adet locasyonumuz tanımlıdır. Bunlardan birisi "location ~ \.php$" dir ki bu lokasyon php kurduğumuzda eklemiz geren .php uzantıları çalıştıracak parametrenin bulunduğu kısımdır. diğeri ise "location /" dir yani apachenin "htdocs" u yada "publick_html" sidir.

.htaccess ayarlarımız işde tam bu "location /" de yapıcaz

örnek .htaccess dosyam :





Nginx de rewrite yazmaya başlarken if koşulunu yazmak mecburiyetindeyiz.

yukarıdaki gördüğünüz .htaccess dosyasından çok farklı ruleset iniz yoksa sizinde yazıcağınız ifade if (!-f $request_filename) olucaktır.

Yani istek gönderilen dosya yoksa sizin belirleyeceğinize rewrite yapsın.




yani kısaca yukarıdaki kodum şu şekilde değişecek :







Bunu manuel olarak yapamıyorsanuz, Buyrun .htaccess nginx convert: Convert apache htaccess to nginx



görüldüğü gibi arasında çokda fark yok.Bu oluşturduğunu ruleleri "location /" e ekleyip ngin i restart yaptıkdan sonra artık elveda apache diyebilirsiniz.







Kaynak için: Meksikalı 'ya teşekkürler...













Tamam iyi hoş Güzelde :D Ya ben Yanlış Okuyorum Ya sen Sana Attıgım Senin Dosyanın İçinden Cıkan nginx.conf Dosyasını Gormedin .

Senin Verdiğin dosyalar içinde Çıkan Kodlarda 2 Tane location / Kısmı Var ctrf+f yaparsan görürsün direk :) ++++ seven panelin htacceslerinide attım o oto değiştiren sitedeki yerden yaptığımda sadece

rewrite ^/usercp$ /index.php?pages=usercp last;

gibi komutlar değilde bizim htaccesin basındaki yazılardan galiba bazı if döngüleri daha cıkıyor

if (!-f $request_filename){

set $rule_0 1$rule_0;

}

if (!-d $request_filename){

set $rule_0 2$rule_0;

}

if ($rule_0 = "21"){

rewrite ^/login$ /index.php?pages=login last;

}

rewrite ^/logout$ /index.php?pages=logout last;

rewrite ^/usercp$ /index.php?pages=usercp last;





ben yukarıda convert edilmiş halini de attım senin dosyalardan cıkan nginx.conf dosyasınıda attım orjinal htacces ide attım bi zahmet o kodlarla yaparmısın bana burdan paylaşırmısın . sevenpanelv8 için herkez kullanabilir hem . (ben beceriksizim beceremedim demenin kibar halini dedim insallah yaparsın :D )
 
L Çevrimdışı

Lider

Kayıtlı Üye
2 Nisan 2013
56
0
6
34
Cevap: Nginx Sistemi ile Kopanelinizi Çalıştırın ve Sunucuzu rahatlatın (KO-FOX Farkıyla)



by_bts seven panel için olanları bilisimtitan ın dedigi gibi yaparmısınız bizde kullanalım bizde yapamadık
 
S Çevrimdışı

Snakeman

Kayıtlı Üye
10 Nisan 2012
132
0
16
28
Cevap: Nginx Sistemi ile Kopanelinizi Çalıştırın ve Sunucuzu rahatlatın (KO-FOX Farkıyla)



Teşekkürler..
 
B Çevrimdışı

bilisimtitan

Kayıtlı Üye
1 Nisan 2013
231
0
16
34
sorunu buldum @by_bts

ama nasıl çözeriz yardımını bekliyorum rewriteler bi şekilde tamamde

siteye girince



pagina_atual = 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']; $this->md5_pg = md5($this->pagina_atual).".".self::$extensao_padrao; $this->arquivo = self::$dir_cache.$this->md5_pg; $this->opcoes = "basico"; $this->acao = false; $this->retorno = true; //array com as opcoes de debug $this->arr_debug = array("atualizar","limpar","matar"); //cria o diretorio e da permissao de acesso @mkdir(self::$dir_cache,0777,true); @chmod(self::$dir_cache,0777); //pega os parametros de debug via url if(self::$editar_via_url != false && self::$string_separatoria != false) { //separa a string em partes $arr_url = explode(self::$string_separatoria,$this->pagina_atual); //pega a acao que sera executada $this->acao = $arr_url[count($arr_url)-1]; }elseif(self::$editar_via_url != false && isset($_GET['cache_debug'])){ //pega a acao que sera executada $this->acao = $_GET['cache_debug']; } } /* funcao que mostra o conteudo gravado no cache caso ele exista */ public function KagaCache() { //verifica se o metodo e um metodo post if($_SERVER['REQUEST_METHOD'] != "POST") { //se a opcao de debug estiver no array if($this->acao != false && in_array($this->acao,$this->arr_debug)) { switch($this->acao) { case "atualizar": default: $this->retorno = false; break; //apaga o arquivo atual case "limpar": @unlink($this->arquivo); break; //apaga todos os arquivos de cache case "matar": if($dir = opendir(self::$dir_cache)) { while(false !== ($file = readdir($dir))) { if($file != "." and $file != "..") { @unlink(self::$dir_cache.$file); } } closedir($dir); } } /* se o arquivo existir entao da um include dele na pagina */ } elseif(file_exists($this->arquivo) && (time() - self::$tempo_cache < filemtime($this->arquivo))) { include($this->arquivo); exit; } /* Ativa o buffer de saída / ob_gzhandler - faz a compressao do arquivo */ if($this->retorno != false) { ob_start("ob_gzhandler"); } } } /* funcao que gera o arquivo com o seu conteudo */ public function CriaCache($opcoes="") { //verifica se o metodo e um metodo post if($_SERVER['REQUEST_METHOD'] != "POST" || $this->retorno != false) { /* abre o arquivo para escrita */ $fp = fopen($this->arquivo,"w"); /* verifica se foi escolhida uma opcao, caso nao for e definido um valor padrao para a opcao */ if($opcoes == "") { $opcoes = $this->opcoes; } /* verificando as opcoes escolhidas e fazendo o tratamento (retirando os espacos em branco) */ switch($opcoes) { case "basico": default: $buffer = ob_get_contents(); break; case "normal": $buffer = str_replace(array("\r\n", "\r", "\n", "\t"), '', ob_get_contents()); break; case "agressivo": $buffer = str_replace(array("\r\n", "\r", "\n", "\t", ' ', ' ', ' '), '', ob_get_contents()); break; } /* salva o conteudo do buffer no arquivo */ fwrite($fp,$buffer); /* fecha o arquivo e joga o conteudo para o browser */ fclose($fp); ob_end_flush(); } } } ?>





hata veriyor en uste sebebide şu

index.php de sunlar var

<?php

ob_start( );

session_start( );

define( "SEVENPANEL", 1, true );

include( "config/config.inc.php" );

include( LIBRARY."dbo.lib.php" );

$sevendbo = new SevenDBO( $db['db_name'], $db['db_user'], $db['db_pass'] );

include( "inc_sql/base_url.php" );

include( "inc_sql/lang.php" );

include( LIBRARY."cache.lib.php" );

include( "inc_sql/cache.php" );

define( "cache_mode", $cache_mode );

define( "cache_time", $cache_time );

include( LIBRARY."template.lib.php" );

?>









o hatadaki kodların %99 u config.inc.php bu kısımda ne işe yarıyor bu nasıl hallederiz anlayamadım
 
H Çevrimdışı

hamza000

Kayıtlı Üye
7 Nisan 2012
113
0
16
33
Cevap: Nginx Sistemi ile Kopanelinizi Çalıştırın ve Sunucuzu rahatlatın (KO-FOX Farkıyla)



çok teşekkürler
 
C Çevrimdışı

center

Kayıtlı Üye
19 Nisan 2013
88
0
6
34
Cevap: Nginx Sistemi ile Kopanelinizi Çalıştırın ve Sunucuzu rahatlatın (KO-FOX Farkıyla)



eyw
 
B Çevrimdışı

bylavira

Kayıtlı Üye
18 Eylül 2012
453
1
18
30
Cevap: Nginx Sistemi ile Kopanelinizi Çalıştırın ve Sunucuzu rahatlatın (KO-FOX Farkıyla)



teşekkürler
 
T Çevrimdışı

TheKinqDewiL

Kayıtlı Üye
30 Mayıs 2012
555
4
18
30
Cevap: Nginx Sistemi ile Kopanelinizi Çalıştırın ve Sunucuzu rahatlatın (KO-FOX Farkıyla)



teşekkürler
 
E Çevrimdışı
11 Ocak 2012
12,856
108
63
Cevap: Nginx Sistemi ile Kopanelinizi Çalıştırın ve Sunucuzu rahatlatın (KO-FOX Farkıyla)



Yorumlar için teşekkürler
 
A Çevrimdışı

AtknBldk

Kayıtlı Üye
11 Kasım 2012
154
0
16
31
Cevap: Nginx Sistemi ile Kopanelinizi Çalıştırın ve Sunucuzu rahatlatın (KO-FOX Farkıyla)



Teşekkürler farklı bir sistem denemek lazım