I'm migrating a number of ModX Evo websites from my old webserver (Debian / Apache / ISPConfig3) to my new webserver (Debian / Nginx / ISPConfig3).
ISPConfig allows you to add Nginx directives to each vhost, and this is where I've added the following code:
if ($http_user_agent ~* "internal dummy connection") {
return 403;
}
location /manager {
}
location /assets {
}
location / {
if (!-f $request_filename) {
rewrite ^(.*)$ /index.php?q=$1;
}
}
When I turn Friendly URLs and Friendly Aliases on, and set my preferred suffix to .html, then preview a given page (e.g. http://example.com/friendly-url.html), the browser attempts to serve up an HTML page as a download.
(If you download this file and open in a text editor, turns out the file has the exact contents of index.php in the ModX installation root).
What am I doing wrong? How is URL re-writing achieved in nginx? Is this even a URL re-writing issue?
Thanks!