Welcome! Log In Create A New Profile

Advanced

Re: GitHub configuration files

August 25, 2010 04:22PM
I had thought of posting some recipes up at one point as well.

# all other requests go to Wordpress
if (!-e $request_filename) {
rewrite ^/(.*)$ /index.php?q=$1 last;
rewrite /(.*)/$ /index.php?q=$1 last;
break;
}

I don't think you need that; probably simpler to do try_files there.

I haven't used wp supercache; I would make two configs, one for
wordpress and one for wordpress with wp supercache. Because my default
wordpress and drupal configs are basically just try_files lines.

Drupal 6 doesn't support try_files, still needs the if (-e) check.
Drupal 7 works.
Drupal also has a lot of stuff in the document root to set to
"internal" sadly. So I have a location block to handle that.

At the moment, this is my working Drupal 6 config:

if (!-e $request_filename) {
rewrite ^/(.*)$ /index.php?q=$1 last;
}

location ~* \.(engine|inc|info|install|module|profile|po|sh|.*sql|theme|tpl(\.php)?|xtmpl)$|^(code-style\.pl|Entries.*|Repository|Root|Tag|Template)$
{
internal;
}
location ~ /sites/all/scripts/.* { internal; }
location ~ /sites/all/modules/apachesolr/solrbase/.* { internal; }


for wordpress:

all you need is:
try_files $uri $uri/ /index.php?page=$request_uri;

see http://michaelshadle.com/2010/08/20/front-controller-patterns-and-nginx/

always start out simple, and build from there. :)

On Wed, Aug 25, 2010 at 1:09 PM, nofun <nginx-forum@nginx.us> wrote:
> Hello,
>
> I am trying to put together a set of configuration files, generalized
> for different web applications (for the moment just Drupal and
> WordPress) and with added security. All of them will be modular so that
> they can be interchanged, and also I tried to listen to many advices on
> this forum, like the use of try_files instead of if, etc. And of course
> this needs to be very simple and general so any custom modifications
> will be excluded, so that the files can be used on any system and
> application. Also, they are made just for NginX and PHP-FPM (or
> FastCGI)
>
> This is available at http://github.com/vladgh/nginx and I am open to any
> suggestions that you may have.
>
> I am doing this because for the moment finding a good configuration
> example is very difficult and involves a lot of searching and
> trial&error. Most of them are intended for very specific applications
> and must be heavily customized to get them working. You are welcomed to
> add any comment you might have.
>
> Posted at Nginx Forum: http://forum.nginx.org/read.php?2,123720,123720#msg-123720
>
>
> _______________________________________________
> nginx mailing list
> nginx@nginx.org
> http://nginx.org/mailman/listinfo/nginx
>

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx
Subject Author Posted

GitHub configuration files

nofun August 25, 2010 04:09PM

Re: GitHub configuration files

mike August 25, 2010 04:22PM

Re: GitHub configuration files

nofun August 25, 2010 04:26PM

Re: GitHub configuration files

Anonymous User August 25, 2010 08:46PM

Re: GitHub configuration files

nofun August 25, 2010 09:24PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 50
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready