#1  
Old 26th April 2012, 10:18
icphedia icphedia is offline
Junior Member
 
Join Date: Jul 2006
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default nginx rewrite for drupal

hi,

i installed ispconfig3 nginx on centos 6.2

everything works fine except drupal 7 clean urls.

i tried some directives on ispconfig nginx Directives settings but wont work.

any suggestions?
Reply With Quote
Sponsored Links
  #2  
Old 27th April 2012, 13:05
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,740 Times in 2,575 Posts
Default

Try this in the nginx Directives field on the Options tab:

Code:
       # Make sure files with the following extensions do not get loaded by nginx because nginx would display the source code, and these files can contain PASSWORDS!
        location ~* \.(engine|inc|info|install|make|module|profile|test|po|sh|.*sql|theme|tpl(\.php)?|xtmpl)$|^(\..*|Entries.*|Repository|Root|Tag|Template)$|\.php_ {
                deny all;
        }

       location / {
                if ($query_string ~ ".+") {
                        return 405;
                }
                # pass requests from logged-in users to Apache
                if ($http_cookie ~ "DRUPAL_UID" ) {
                        return 405;
                } # pass POST requests to Apache
                if ($request_method !~ ^(GET|HEAD)$ ) {
                        return 405;
                }
                error_page 405 = @nocache;
                # do not allow browsers to cache HTML
                add_header Expires "Sun, 19 Nov 1978 05:00:00 GMT";
                add_header Cache-Control "no-store, no-cache, must-revalidate, post-check=0, pre-check=0";
                # serve requested content from the cache if available, otherwise pass the request to Apache
                try_files /cache/normal/$host/${uri}_.html /cache/perm/$host/${uri}_.css /cache/perm/$host/${uri}_.js /cache/$host/0$uri.html /cache/$host/0${uri}/index.html @nocache;
       }

       location @nocache {
                try_files $uri $uri/ /index.php?$args;
       }

       location ~*  \.(jpg|jpeg|png|gif|css|js|ico)$ {
                expires max;
                log_not_found off;
       }
(This configuration is for use with Drupal's Boost module.)

The configuration is based on this tutorial: http://www.howtoforge.com/running-dr...e-ubuntu-11.04
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
The Following User Says Thank You to falko For This Useful Post:
sistematico (23rd November 2013)
  #3  
Old 7th May 2012, 13:53
icphedia icphedia is offline
Junior Member
 
Join Date: Jul 2006
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default

thanx falko but it didnt work.

sites working with apache again..
Reply With Quote
  #4  
Old 23rd November 2013, 16:05
sistematico sistematico is offline
Junior Member
 
Join Date: Nov 2013
Posts: 25
Thanks: 4
Thanked 2 Times in 2 Posts
Default

Sorry for necro-posting, but how to fix this: http://img.sistematico.org/images/2013/11/23/drupal.png ?

Thanks again falko.
Reply With Quote
  #5  
Old 23rd November 2013, 16:39
Croydon Croydon is offline
ISPConfig Developer
 
Join Date: Jul 2007
Location: Koblenz, Germany
Posts: 922
Thanks: 16
Thanked 259 Times in 206 Posts
Default

Quote:
Originally Posted by sistematico View Post
Sorry for necro-posting, but how to fix this: http://img.sistematico.org/images/2013/11/23/drupal.png ?

Thanks again falko.
Isn't it quite obvious? There is a link given on each of these warning rows. Just follow it and follow the instructions there
__________________
Marius Cramer

pixcept KG
Reply With Quote
  #6  
Old 23rd November 2013, 18:36
sistematico sistematico is offline
Junior Member
 
Join Date: Nov 2013
Posts: 25
Thanks: 4
Thanked 2 Times in 2 Posts
Default

Quote:
Originally Posted by Croydon View Post
Isn't it quite obvious? There is a link given on each of these warning rows. Just follow it and follow the instructions there
No, is not obvious.
Im using Nginx, this instructions is for Apache.
Reply With Quote
  #7  
Old 24th November 2013, 10:50
Croydon Croydon is offline
ISPConfig Developer
 
Join Date: Jul 2007
Location: Koblenz, Germany
Posts: 922
Thanks: 16
Thanked 259 Times in 206 Posts
 
Default

You can rewrite nearly all htaccess rewrite or deny/allow directives to nginx.
If you don't know how, maybe this would be a first step:
http://winginx.com/htaccess
__________________
Marius Cramer

pixcept KG
Reply With Quote
The Following User Says Thank You to Croydon For This Useful Post:
sistematico (24th November 2013)
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
nginx Segmentation fault Error,The Perfect Server - CentOS 6 With nginx [ISPConfig 3] alihan1988 HOWTO-Related Questions 0 2nd February 2012 17:07
Major recovery Toucan Installation/Configuration 18 9th August 2011 11:45
A Working Nginx Catchall with ISPConfig 3. renders Tips/Tricks/Mods 4 15th April 2011 21:53
Nginx and PHP and Fastcgi Paladinemishakal Installation/Configuration 1 4th January 2011 13:45
How to change rewrite from apache to nginx vuit Server Operation 0 24th February 2010 07:45


All times are GMT +2. The time now is 14:53.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.