Old 18th February 2014, 00:06
badenzer badenzer is offline
Junior Member
Join Date: Jun 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Unhappy Silverstripe on nginx


I had installed Silverstripe on nginx with SilverStripe 3.1.2 on Debian 7.
When I install Silverstripe in the default root directory, all works very well.
But when I want to install it to an subdir like /cms, I can do the setup and the site will show up successfully. But when I open the site new, I get an Error 404.

I used this nginx Directives in ISPconfig:

location ^~ /assets/ {
                try_files $uri =404;
                expires max;
                access_log off;
                log_not_found off;
       location ~ \.ss {
                deny all;
       location ~ web\.config {
                deny all;
       location ~ \.(ya?ml|bak|swp)$ {
                deny all;
       location ~ ~$ {
                deny all;
       location ^~ /silverstripe-cache/ {
                deny all;
       location ^~ /vendor/ {
                deny all;
       location ~ /composer\.(json|lock) {
                deny all;
       location ~ ^/framework/(.+/)?(main|rpc|tiny_mce_gzip)\.php$ {
                try_files /6c1ec1bb21001dd913db95cfb05d78d7.htm @php;
       location ~ ^/(cms|framework|mysite)/.+\.(php|php[345]|phtml|inc)$ {
                deny all;
       location ~ ^/(cms|framework)/silverstripe_version$ {
                deny all;

       error_page 404 /assets/error-404.html;
       error_page 500 /assets/error-500.html;

       location / {
                 if (!-f $request_filename) {
                    rewrite ^/(.*?)(\?|$)(.*)$ /framework/main.php?url=$1&$3 last;

       location ~ ^/(index|install)\.php/ {
                fastcgi_split_path_info ^((?U).+\.php)(/?.+)$;
                include /etc/nginx/fastcgi_params;
                fastcgi_pass unix:/var/run/php5-fpm.sock;
                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

       location ~ \.php$ {
                try_files /6c1ec1bb21001dd913db95cfb05d78d7.htm @php;

       location @php {
                try_files $uri =404;
                include /etc/nginx/fastcgi_params;
                fastcgi_pass unix:/var/run/php5-fpm.sock;
                fastcgi_index index.php;
                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                fastcgi_intercept_errors on;
                fastcgi_temp_file_write_size 10m;
                fastcgi_busy_buffers_size    512k;
                fastcgi_buffer_size          512k;
                fastcgi_buffers           16 512k;
                fastcgi_read_timeout 1200;
from timmehosting.de.
This works fine as long as I install it to the root dir for example

How to change this for the Subdir like /cms/ ?
For example:

I changed the Directives to fit for me (like I thought), but it won't work.

I hope anyone can help me.

With kind regards,
Reply With Quote
Sponsored Links


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Go from Apache to Nginx scottrill2 Installation/Configuration 0 15th June 2013 16:06
Nginx doesnt start without any output cyprus Server Operation 2 4th June 2013 23:58
Please help convert htaccess to nginx ababneh HOWTO-Related Questions 6 5th April 2013 01:19
nginx Reverse Proxy on Separate Server from Apache atjensen11 HOWTO-Related Questions 2 8th September 2012 23:26
A Working Nginx Catchall with ISPConfig 3. renders Tips/Tricks/Mods 4 15th April 2011 22:53

All times are GMT +2. The time now is 16:47.

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