View Single Post
  #5  
Old 2nd February 2013, 01:03
onastvar onastvar is offline
Senior Member
 
Join Date: Apr 2008
Location: U.S.A.
Posts: 188
Thanks: 59
Thanked 10 Times in 10 Posts
Default

nginx Directives

Code:
location / {
                try_files $uri $uri/ /index.php?$args;
           }

       # Add trailing slash to */wp-admin requests.
       rewrite /wp-admin$ $scheme://$host$uri/ permanent;

       location ~*  \.(jpg|jpeg|png|gif|css|js|ico)$ {
                expires max;
                log_not_found off;
       }
# Deny public access to wp-config.php
location ~* wp-config.php { 
    deny all; 
}

location /phpmyadmin {
               root /usr/share/;
               index index.php index.html index.htm;
               location ~ ^/phpmyadmin/(.+\.php)$ {
                       try_files $uri =404;
                       root /usr/share/;
                       fastcgi_pass 127.0.0.1:9000;
                       fastcgi_param HTTPS $fastcgi_https; # <-- add this line
                       fastcgi_index index.php;
                       fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                       include /etc/nginx/fastcgi_params;
                       fastcgi_buffer_size 128k;
                       fastcgi_buffers 256 4k;
                       fastcgi_busy_buffers_size 256k;
                       fastcgi_temp_file_write_size 256k;
                       fastcgi_intercept_errors on;
               }
               location ~* ^/phpmyadmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ {
                       root /usr/share/;
               }
        }
        location /phpMyAdmin {
               rewrite ^/* /phpmyadmin last;
        }
# Support Clean (aka Search Engine Friendly) URLs</tt>
        location /demo/joomla/ {
                try_files $uri $uri/ /demo/joomla/index.php?q=$request_uri;
        }
when I add the following code to above Nginx Directives I get 404 Not Found

Code:
location /demo/concrete5 {
  root /demo/concrete5;
  index  index.html index.htm index.php;
  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 ^/(.*)$ /index.php/$1 last;
  }

  location ~ \.php($|/) {
    try_files $uri =404;
    set  $script     $uri;
    set  $path_info  "";
    if ($uri ~ "^(.+\.php)(/.+)") {
      set  $script     $1;
      set  $path_info  $2;
    }
    fastcgi_pass unix:php5-fpm-sock;
    fastcgi_index  index.php;
    include /etc/nginx/fastcgi_params;
    fastcgi_param  URI $uri;
    fastcgi_param  PATH_INFO        $path_info;
    fastcgi_param  SCRIPT_NAME      $script;
    fastcgi_param  SCRIPT_FILENAME  /demo/concrete/concrete5$script;
  }
}
__________________
ISPConfig 3.0.5.4p1 | Debian Wheezy | BIND | Dovecot 1.2.15 | Apache 2.2.16 | MySQL 5.5 | PHP 5.4.4-14

Last edited by onastvar; 2nd February 2013 at 07:10.
Reply With Quote