Welcome Guest, Not a member yet? Register   Sign In
codeigniter and joomla together on nginx webserver
#1

hello. 
i have a site that main domain is created by joomla , 
i make another folder with name newashosite and paste my codeigniter in it , 
then , i change configuration settings and im sure they are right , 
now when i insert website name on browser , it shows me codeigniter " 404 not found "'s page ,
i change nginx.conf settings to this  : 

Code:
server {

   listen 80;

   server_name mysite.com *.mysite.com www.mysite.com;
   index index.php;

   set $root_path '/www/mysite.com';
   root $root_path;

#    add_header X-Frame-Options "SAMEORIGIN";

 client_max_body_size 1024M ;
 keepalive_requests 10000;





     location / {
    root   $root_path;
       try_files $uri $uri/ /index.php?$args;
#        try_files    $uri =404;
       index  index.php index.html index.htm;
       proxy_read_timeout 600;
       expires 3h;

rewrite ^/(welcome(/index)?|index(\.php)?)/?$ / redirect;
rewrite ^/(.*)/index/?$ /$1 redirect;
if (!-e $request_filename){
rewrite ^/(.+)/$ /$1 redirect;
}
if ($http_host !~ "^(www|subdomain)"){
rewrite ^(.*)$ http://www.ashpazi.ir/$1 redirect;
}
rewrite ^system.* /index.php/$1 break;
if (!-e $request_filename){
rewrite ^(.*)$ /index.php/$1 break;
}



#if (!-e $request_filename){
#rewrite ^(.*)$ /index.php/ break;
#}

location /newashosite {
               # Check if a file or directory index file exists, else route it to index.php.
               try_files $uri $uri/ /newashosite/index.php;
       }

#        # if file exists return it right away
#        if (-f $request_filename) {
#            break;
#        }
#
#         otherwise rewrite it
#
#        if (!-e $request_filename) {
#            rewrite ^(.+)$ /index.php?_url=$1 last;
#            break;
#        }
}


           location /store {
#               root   /www/mysite.com;
             try_files $uri $uri/ /store/index.php?$args;
#               index index.php;
#               if (!-e $request_filename) {
#               rewrite ^(.*)$ /index.php?url=$1 break;
#            }
}

   location ~ \.php {


       try_files $uri $uri/ /index.php?$args;
       fastcgi_index  index.php;
       fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
       include fastcgi_params;
       fastcgi_read_timeout 600;
       fastcgi_split_path_info       ^(.+\.php)(/.+)$;
       fastcgi_param PATH_INFO       $fastcgi_path_info;
       fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
       fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
       fastcgi_buffers 16 512k;
       fastcgi_buffer_size 512k;
       include fastcgi.conf;
}
location ~*  \.(jpg|jpeg|png|gif|ico|css|js)$ {
  expires 365d;
}

   location ~* ^/(css|img|js|flv|swf|download)/(.+)$ {
       root $root_path;
   }

}
Reply




Theme © iAndrew 2016 - Forum software by © MyBB