I already have that in my config... My config looks like this:
server {
listen 80;
server_name www.domain.no;
access_log /var/log/nginx/domain-access.log;
error_log /var/log/domain-error.log;
location / {
root /www/domaindir;
index index.php;
if (-f $request_filename) {
expires 30d;
break;
}
if (!-e $request_filename) {
rewrite ^(.+)$ /index.php?q=$1 last;
}
}
include global/restrictions.conf;
# Add trailing slash to */wp-admin requests.
rewrite /wp-admin$ $scheme://$host$uri/ permanent;
location ~ [^/]\.php(/|$) {
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
if (!-f /www/domaindir$fastcgi_script_name) {
return 404;
}
fastcgi_pass php;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /www/domaindir$fastcgi_script_name;
include /etc/nginx/fastcgi_params;
}
}
This works but when I change to $document_root, it does not...
Is there a way I can write the value of $document_root to the logfile?
server {
listen 80;
server_name www.domain.no;
access_log /var/log/nginx/domain-access.log;
error_log /var/log/domain-error.log;
location / {
root /www/domaindir;
index index.php;
if (-f $request_filename) {
expires 30d;
break;
}
if (!-e $request_filename) {
rewrite ^(.+)$ /index.php?q=$1 last;
}
}
include global/restrictions.conf;
# Add trailing slash to */wp-admin requests.
rewrite /wp-admin$ $scheme://$host$uri/ permanent;
location ~ [^/]\.php(/|$) {
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
if (!-f /www/domaindir$fastcgi_script_name) {
return 404;
}
fastcgi_pass php;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /www/domaindir$fastcgi_script_name;
include /etc/nginx/fastcgi_params;
}
}
This works but when I change to $document_root, it does not...
Is there a way I can write the value of $document_root to the logfile?