server {
listen 80;
server_name my_site.com www.my_site.com;
#server logs
access_log /var/www/my_site.com/private/logs/access.log;
error_log /var/www/my_site.com/private/logs/error.log;
rewrite_log on;
# check memcache for page existence using uri as key
location /checkmemcache {
internal;
set $memcached_key $request_uri;
memcached_connect_timeout 2000;
memcached_read_timeout 2000;
memcached_pass 127.0.0.1:11211;
default_type text/html;
# if memcache throws one of the following errors head off to
the php-cgi
error_page 404 502 = /edpagegeneration;
}
# Pass the PHP scripts to FastCGI server
# listening on 127.0.0.1:9000
location /edpagegeneration {
internal;
root /var/www/my_site.com/app/webroot;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_intercept_errors on; # to support 404s for PHP files
not found
fastcgi_param SCRIPT_FILENAME
$document_root$fastcgi_script_name;
include fastcgi_params;
}
location / {
#auth_basic "Restricted";
#auth_basic_user_file htpasswd;
root /var/www/my_site.com/app/webroot;
index index.php index.html;
try_files $uri $uri/ /index.php?$uri&$args;
# all non-existing file or directory requests to index.php
if (!-e $request_filename) {
# redirect directly to the main php processing
# rewrite ^(.*)$ /index.php last;
# redirect to memcache page checking first which
will
# then fall through to the php-cgi
rewrite ^(.*)$ /checkmemcache last;
}
}
# Not found this on disk?
# Feed to CakePHP for further processing!
if (!-e $request_filename) {
rewrite ^/(.+)$ /index.php?url=$1 last;
break;
}
# Pass the PHP scripts to FastCGI server
# listening on 127.0.0.1:9000
location ~ \.php$ {
root /var/www/my_site.com/app/webroot;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_intercept_errors on; # to support 404s for PHP files
not found
fastcgi_param SCRIPT_FILENAME
$document_root$fastcgi_script_name;
include fastcgi_params;
}
# Static files.
# Set expire headers, Turn off access log
location ~* \favicon.ico$ {
access_log off;
expires 1d;
add_header Cache-Control public;
}
location ~ ^/(img|js|css)/ {
access_log off;
expires 7d;
add_header Cache-Control public;
}
# Deny access to .htaccess files,
# git & svn repositories, etc
location ~ /(\.ht|\.git|\.svn) {
deny all;
}
}
Thanks again all,
Dave
From: Advantage+ [mailto:[email protected]]
Sent: Sunday, November 11, 2012 8:34 PM
To: [email protected]
Subject: No CSS / JS / Images
I have just moved over to an nginx setup.
I had this site built before but took it down, so now putting it back up but
using Cake 2.2.3
I have pretty urls and all that from the existing setup.
Only now I have styles-less / script-less / image-less pages.
All come up 404 not found.
I have checked rechecked re-uploaded the webroot and the files are there and
the urls are infact correct.
Try to access any of the 404 files directly and I get the Missing Controller
page.
Hmm any ideas?
Thanks for any input.
Dave
--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
---
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
Visit this group at http://groups.google.com/group/cake-php?hl=en.