How do I “pass the request directly to the script with parameters ”?
server {
listen 80 defaultserver;
listen [::]:80 defaultserver ipv6only=on;
root /var/www/example/html;
index index.php index.html index.htm;
error_page 403 /customerror/403;
errorpage 404 /404.html;
errorpage 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
location = /favicon.ico {
lognotfound off;
access_log off;
}
location = /robots.txt {
allow all;
lognotfound off;
access_log off;
}
location ~ ../..php$ {
return 403;
}
location ~ ^/sites/.*/private/ {
return 403;
}
location /wordpress {
return 403;
}
location /getmoreinfo {
return 403;
}
location /fckeditor {
return 403;
}
location /teaching-artist {
rewrite /teaching-artist/(.)$ http://example/teaching-artist/$1;
}
location /print/content {
rewrite /print/content/(.)$ http://example/print/content/$1;
}
location /content {
rewrite ^/content/([^]*)([^]*)([^]*)([^]*)([^]*)([^]*)([^]*)([^]*)(.)$ http://centerforartsed.org/mediaclips/$1-$2-$3-$4-$5-$6-$7-$8-$9;
rewrite ^/content/([^_])([^])([^])([^])_(.)$ http://example.org/mediaclips/$1-$2-$3-$4-$5;
rewrite ^/content/([^]*)([^]*)(.)$ http://example.org/mediaclips/$1-$2-$3;
rewrite ^/content/([^_])_(.*)$ http://example.org/mediaclips/$1-$2;
}
location /wpadmin {
return 403;
}
location ~ (^|/). {
return 403;
}
location / {
try_files $uri @rewrite;
}
location @rewrite {
rewrite ^ /index.php;
}
location ~ .php$ {
fastcgisplitpathinfo ^(.+.php)(/.+)$;
include fastcgiparams;
fastcgiparam SCRIPTFILENAME $requestfilename;
fastcgiintercepterrors on;
fastcgipass unix:/var/run/php5-fpm.sock;
}
location ~ ^/sites/.*/files/styles/ {
try_files $uri @rewrite;
}
location ~* .(js|css|png|jpg|jpeg|gif|ico)$ {
expires max;
lognotfound off;
}
}
Can you share your full nginx conf for this site? It sounds like you may either need to pass the request directly to the script with parameters rather than using the rewritten url for your error page or your nginx configuration requires some other changes.