Can I debug a file served using Nginx's X-Accel-Redirect with Phpstorm?

I'm using Nginx's X-Accel-Redirect to serve a file that is outside of the webroot. The webroot is /usr/share/nginx/html and the file I am wanting to debug is being served from /usr/share/nginx/downloads

I begin xdebug in the browser (debugging works at this stage). At some point the browser makes a request for website1.com/learning/downloads/url
Nginx redirects the request to redirected.php using the below rule

# Enable X-Accel-Redirect
location /learning/downloads/ {
root /usr/share/nginx/downloads;
rewrite ^/(.*)$ /redirected.php last;
}

Unfortunately, I can't get redirected.php to pause on any breakpoints. Is it simply not possible when using X-Accel-Redirect? or could it be a mapping issue?

Any help would be much appreciated!

0
1 comment

It turned out to be a mapping issue, so yes, files that are served using X-Accel-Redirect can be debugged.

1

Please sign in to leave a comment.