Sponsor:

Server and Web Integrator
Link:
Kloxo-MR logo
6.5.0 or 7.0.0
Click for "How to install"
Donation/Sponsorship:
Kloxo-MR is open-source.
Donate and or Sponsorship always welcome.
Click to:
Click Here
Please login or register. 2024-04-27, 19:34:13

Author Topic: nginx rewrite rules!  (Read 2933 times)

0 Members and 1 Guest are viewing this topic.

Offline milad_a

  • Junior Member
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
nginx rewrite rules!
« on: 2013-05-06, 16:34:12 »
hi

i try to swith my web server to nginx from apache , i have VBulletin forums , after some code changing i can open my first page forum! but i have VBSEO and it need some rewrite URLs i try to put it in nginx.conf , on *.domain.tpl and others but all codes back me to first page of forum! i get this code for nginx from VBSEO official forum :

Quote
location /forums/ {
rewrite ^/forums/((urllist|sitemap_).*.(xml|txt)(.gz)?)$ /forums/vbseo_sitemap/vbseo_getsitemap.php?sitemap=$1 last;

try_files $uri $uri/ /forums/vbseo.php?$args;
}

location ~ /forums/(.*.php)$ {
rewrite ^/forums/(.*)$ /forums/vbseo.php last;
}
location /forums/vbseo/(includes|resources/html|resources/xml)/ {
    allow      127.0.0.1;
    deny      all;
}

replace /forum/ to my forum folder path but nginx give error that "location" or "server" is not a recognized command! try to use rewrite lines only like:

rewrite ^/forums/(.*)$ /forums/vbseo.php last;

again no success! can any body give me working rewrite url for nginx from above codes?

in addition when i try /script/fixweb , all added code will be remove! and i must insert again!
« Last Edit: 1970-01-01, 01:00:00 by Guest »

Offline MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 15,807
  • Karma: +119/-11
  • Gender: Male
    • View Profile
    • MRatWork Forum
Re: nginx rewrite rules!
« Reply #1 on: 2013-05-06, 16:38:50 »
Copy /home/nginx/tpl/domains.conf.tpl to /home/nginx/tpl/custom.domains.conf.tpl  and then modified this custom file with php code (because tpl using 'inline-php').

After that, run 'sh /script/fixweb; sh /script/restart-services'.
« Last Edit: 1970-01-01, 01:00:00 by Guest »
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

 


MRatWork Affiliates:    BIGRAF(R) Inc.    House of LMAR    EFARgrafix
Click Here

Page created in 0.027 seconds with 18 queries.

web stats analysis