Monday, 26 August 2013

Nginx serving php as text (want to serve html, not php)

Nginx serving php as text (want to serve html, not php)

Here is my basic config:
server {
server_name mysite.dev;
root location/of/my/html;
location / {
index index.html;
try_files $uri $uri/ =404;
}
}
Yet when I browse to mysite.dev I receive text for a php file:
<?php
if(!defined('APPLICATION_ENV')) {
define('APPLICATION_ENV', (getenv('APPLICATION_ENV') ?
getenv('APPLICATION_ENV') : 'production'));
}
define('ROOT_PATH', realpath(dirname(__FILE__)));
define('LIBRARY_PATH', ROOT_PATH . '/library');
.....etc
Here's the thing, I don't even want to serve PHP at all. I just want to
serve the files as they are, no server-side processing.

No comments:

Post a Comment