with apache I use a file config.php to rewrite a file config.js based on domain, config.js contains placeholders which are replaced by RewriteRule directive, this is .htaccess file:
<IfModule mod_rewrite.c>
RewriteBase /foo
RewriteEngine On
RewriteRule config.js config.php [L,QSA]
</IfModule>
When i go into URL production.com/foo/config.js i see some values, instead into develop.com/foo/config.js i see other values, defined into config.php
Now i need move to nginx but i don't understand how to replicate the apache rule, i tried:
location /foo {
alias /src/www/foo;
index index.html;
rewrite config.js config.php break;
}
But have internal server error
Thanks
lastinstead ofbreakbut didn't change it in a config code block. Updated an answer.