I am trying to basically create an alias for a PHP file. So, instead of the location being at /srv/www/wp/wp-config.php, I want to alias to /srv/www/configs/wp-config.php. I have setup nginx as follows:
server {
listen 80;
server_name localhost;
root /srv/www;
index index.html index.htm index.php;
access_log /var/log/nginx/vhosts/access.log;
error_log /var/log/nginx/vhosts/error.log;
location ~ wp-config\.php {
alias /srv/www/configs/$1;
}
location ~ \.php$ {
fastcgi_intercept_errors off;
try_files $uri $uri/ /index.php?q=$uri&$args;
fastcgi_pass php1.local.mydomain.com:9000;
}
location ~* \.(?:ico|css|js|gif|jpe?g|png)$ {
expires max;
add_header Pragma public;
add_header Cache-Control "public, must-revalidate, proxy-revalidate";
}
}
This is not working. My first question; will nginx first hit the location block wp-config.php and do the alias, and then hit the php execution block \.php$? Or will it only hit the first block and not continue?
Also, how can I get this working.
Thanks.
Edited 1 time(s). Last edit at 02/13/2012 08:56PM by justin.