location matching.
Steve Wilson
lists-nginx at swsystem.co.uk
Sun May 12 14:25:56 UTC 2013
I've just had to move subversion onto a server that's already serving
network wordpress via nginx. Most things work via /svn in a subversion
client but I can't for the life of me figure out how to stop /svn.*\.php
hitting the fastcgi_pass.
I'm sure it's simple and I'm just not seeing the wood for the trees.
Here's the nginx access_log entry:
1.1.1.1 - - [12/May/2013:14:16:01 +0000] "OPTIONS /svn/live/s.php
HTTP/1.1" 404 47 "-" "SVN/1.7.8/TortoiseSVN-1.7.11.23600 neon/0.29.6"
server block:
server {
listen 80 default; ## listen for ipv4
listen 443 default ssl; ## listen for ipv4
listen [::]:80 default; ## listen for ipv6
listen [::]:443 default ssl; ## listen for ipv6
server_name abc.xyz.com;
server_name def.xyz.com;
root /srv/sites/docroot;
ssl_certificate /etc/ssl/STAR.xyz.com.pem;
ssl_certificate_key /etc/ssl/STAR.xyz.com.pem;
index index.php index.php5 index.html index.htm;
client_max_body_size 300M;
location ~ /svn {
proxy_pass http://apache;
proxy_set_header X-Real-IP $remote_addr;
}
location ~ \.(php|php5) {
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $fastcgi_script_name;
include /etc/nginx/fastcgi_params;
fastcgi_pass unix:/var/run/php/wp-sites;
}
# multi site rule
location / {
try_files $uri $uri/ /index.php?$args;
}
rewrite /wp-admin$ $scheme://$host$uri/ permanent;
location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
expires 24h;
log_not_found off;
}
rewrite /files/$ /index.php last;
set $cachetest
"$document_root/wp-content/cache/ms-filemap/${host}${uri}";
if ($uri ~ /$) {
set $cachetest "";
}
if (-f $cachetest) {
rewrite ^ /wp-content/cache/ms-filemap/${host}${uri} break;
}
if ($uri !~ wp-content/plugins) {
rewrite /files/(.+)$ /wp-includes/ms-files.php?file=$1 last;
}
if (!-e $request_filename) {
rewrite ^/[_0-9a-zA-Z-]+(/wp-.*) $1 last;
rewrite ^/[_0-9a-zA-Z-]+.*(/wp-admin/.*\.php)$ $1 last;
rewrite ^/[_0-9a-zA-Z-]+(/.*\.php)$ $1 last;
}
}
nginx -v:
nginx version: nginx/1.4.1
TLS SNI support enabled
configure arguments: --prefix=/usr/share/nginx
--conf-path=/etc/nginx/nginx.conf
--error-log-path=/var/log/nginx/error.log
--http-client-body-temp-path=/var/lib/nginx/body
--http-fastcgi-temp-path=/var/lib/nginx/fastcgi
--http-log-path=/var/log/nginx/access.log
--http-proxy-temp-path=/var/lib/nginx/proxy
--http-scgi-temp-path=/var/lib/nginx/scgi
--http-uwsgi-temp-path=/var/lib/nginx/uwsgi
--lock-path=/var/lock/nginx.lock --pid-path=/var/run/nginx.pid
--with-pcre-jit --with-debug --with-file-aio --with-http_addition_module
--with-http_dav_module --with-http_geoip_module
--with-http_gzip_static_module --with-http_image_filter_module
--with-http_realip_module --with-http_secure_link_module
--with-http_stub_status_module --with-http_ssl_module
--with-http_sub_module --with-http_xslt_module --with-ipv6 --with-mail
--with-mail_ssl_module
--add-module=/usr/src/nginx/source/nginx-1.4.1/debian/modules/nginx-auth-pam
--add-module=/usr/src/nginx/source/nginx-1.4.1/debian/modules/nginx-dav-ext-module
--add-module=/usr/src/nginx/source/nginx-1.4.1/debian/modules/nginx-echo
--add-module=/usr/src/nginx/source/nginx-1.4.1/debian/modules/nginx-upstream-fair
--add-module=/usr/src/nginx/source/nginx-1.4.1/debian/modules/nginx-syslog
--add-module=/usr/src/nginx/source/nginx-1.4.1/debian/modules/nginx-cache-purge
--add-module=/usr/src/nginx/source/nginx-1.4.1/debian/modules/ngx_http_pinba_module
--add-module=/usr/src/nginx/source/nginx-1.4.1/debian/modules/ngx_http_substitutions_filter_module
--add-module=/usr/src/nginx/source/nginx-1.4.1/debian/modules/nginx-x-rid-header
--with-ld-opt=-lossp-uuid
Regards
Steve.
More information about the nginx
mailing list