# Stupid question

**URL:** <https://www.ruby-forum.com/t/stupid-question/186890>\
**Category:** NGINX\
**Created:** [April 13, 2010, 9:39pm UTC](https://www.ruby-forum.com/t/stupid-question/186890 "2010-04-13T21:39:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nuno\_MagalhSSSSes](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/c89c15/32.png) [@Nuno\_MagalhSSSSes](https://www.ruby-forum.com/u/Nuno_MagalhSSSSes)\
**Post date:** [April 13, 2010, 9:39pm UTC](https://www.ruby-forum.com/t/stupid-question/186890/1 "2010-04-13T21:39:07Z")

</div>

I have this config:

server {  
listen 8080;  
server\_name localhost;

```
    access_log /var/log/nginx/site.access.log;
    error_log /var/log/nginx/site.error.log;
    charset utf-8;

    if ($request_method !~ ^(GET|HEAD|POST)$ ) {
            return 444;
    }

    location / {
            root /var/www/nginx-default/site;
            index index.html;
            try_files $uri $uri/ $uri/site.html;
    }
    location = /favicon.ico {
            return 204;
    }
    location ~ \.(php|html)$ {
            fastcgi_pass localhost:1234;
            include fastcgi_params;
            fastcgi_index index.html;
            fastcgi_param SCRIPT_FILENAME

```

/var/www/nginx-default/site$fastcgi\_script\_name;  
fastcgi\_param DOCUMENT\_ROOT /var/www/nginx-default/site;  
fastcgi\_intercept\_errors on;  
}

```
    error_page 404 403 /40x.html;
    location = /40x.html {
            root /var/www/nginx-default/site/epages;
    }

```

}

All my files are .html. Any regular page will have its php parsed, but  
all error pages will only parse html. I.e., if i have this code:

error \<?php echo '404'; ?\>

The php will be parsed if it’s not an error page. What am i missing  
here?

TIA and sorry for a basic question,  
Nuno

–  
() ascii-rubanda kampajno - kontraÅ­ html-a retpoÅto  
/\ ascii ribbon campaign - against html e-mail

---

<div class="post-metadata">

**Author:** ![Nuno\_MagalhSSSSes](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/c89c15/32.png) [@Nuno\_MagalhSSSSes](https://www.ruby-forum.com/u/Nuno_MagalhSSSSes)\
**Post date:** [April 13, 2010, 10:32pm UTC](https://www.ruby-forum.com/t/stupid-question/186890/2 "2010-04-13T22:32:59Z")

</div>

Hello!

On Tue, Apr 13, 2010 at 08:38:09PM +0100, Nuno MagalhÃ£es wrote:

> I have this config:

[…]

> ```
> location ~ \.(php|html)$ {
> fastcgi_pass localhost:1234;
> 
> ```

[…]

> error \<?php echo '404'; ?\>
> 
> The php will be parsed if it’s not an error page. What am i missing here?

You have fastcgi\_pass to php for .html files, but not for  
/40x.html. See here for details:

> **[GitHub - nginxinc/nginx-wiki: ARCHIVED -- Source for the now archived NGINX Wiki...](https://github.com/nginxinc/nginx-wiki)**
>
> ARCHIVED -- Source for the now archived NGINX Wiki section of https://www.nginx.com

Maxim D.
