Welcome! Log In Create A New Profile

Advanced

Alias Wordpress Configuration File To Different Location

Posted by Anonymous User 
Anonymous User
Alias Wordpress Configuration File To Different Location
February 13, 2012 08:55PM
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.
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 234
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready