HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   Installation/Configuration (http://www.howtoforge.com/forums/forumdisplay.php?f=27)
-   -   nginx rewrite for drupal (http://www.howtoforge.com/forums/showthread.php?t=57066)

icphedia 26th April 2012 10:18

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?

falko 27th April 2012 13:05

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

icphedia 7th May 2012 13:53

thanx falko but it didnt work.

sites working with apache again..

sistematico 23rd November 2013 16:05

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

Thanks again falko.

Croydon 23rd November 2013 16:39

Quote:

Originally Posted by sistematico (Post 306231)
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 ;)

sistematico 23rd November 2013 18:36

Quote:

Originally Posted by Croydon (Post 306236)
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.

Croydon 24th November 2013 10:50

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


All times are GMT +2. The time now is 04:42.

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