If you want it mod_rewrite style (so no 302 Temporary Redirect header): location ^/wp-content/themes/mytheme/assets/css/ { rewrite custom.css custom.php; } Posted at Nginx Forum: http://forum.nginx.org/read.php?2,220792,220906#msg-220906