Welcome! Log In Create A New Profile

Advanced

Inner web-application in sub-folder

Posted by vitalyiegorov 
Inner web-application in sub-folder
October 03, 2015 03:53AM
We have default configuration for apache via .htaccess for next structure:
/www-root - is the main site with front controller index.php with mod_rewrite & htaccess
/www-root/cms - is inner web-application(actually a separate web-site) with front controller with mod_rewrite & htaccess

htaccess have the same structure https://github.com/samsoncms/cms/blob/master/www/.htaccess
just redirect all requests to index.php hatches is the same for main web-application and for inner

Now we are moving our servers to nginx+varnish because of awesome facts_cache module and cannot configure inner web-application to run.

We are searching for someone two help us and configure this structure, we are using php-fpm and this is our nginx config:

fastcgi_cache_path /tmp/cache levels=1:2 keys_zone=samsonos:100m inactive=60m;
fastcgi_cache_key "$scheme$request_method$host$request_uri";

server {
listen 8081;

root /www/samsonos.com/www/;
index index.php index.html index.htm;

#PHP cache using
set $no_cache 0;

server_name samsonos.com;

# Main web-application configuration
location = / {
try_files @site @site;
}

location @site {
#Configure cache
fastcgi_cache samsonos;
fastcgi_cache_valid 200 3m; # Only cache 200 responses, cache f$
fastcgi_cache_methods GET HEAD; # Only GET and HEAD methods app$
add_header X-Fastcgi-Cache $upstream_cache_status;
fastcgi_cache_bypass $no_cache; # Don't pull from cache based $
fastcgi_no_cache $no_cache; # Don't save to cache based on $no_$

#PHP-FPM config
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root/index.php;
}

#SamsonCMS configuration
location = /cms/ {
try_files @cms @cms;
}

location /cms/ {
try_files $uri $uri/ @cms;
}

location @cms {
#PHP-FPM config
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root/cms/index.php;
}

#return 404 for all php files as we do have a front controller
location ~ \.php$ {
return 404;
}

# Remove loggin for static files and set expires
#location ~* ^.+\.(ogg|ogv|svg|svgz|eot|otf|woff|mp4|ttf|rss|atom|jpg|j$
# access_log off; log_not_found off; expires max;
#}
}

and it does not work, when we open this url /cms it redirects to a /cms/signin/ controller but it considers it as a folder and says restricted instead of redirecting it to a cms/index.php

We are searching for some good expert in nginx on payed basis to help configure optimal config for our system, please contact us via egorov@samsonos.com
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 105
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready