I configured nginx with php-fpm/fastcgi but not receiving headers at PHP end

Ashvin Savani ashvin at avinashi.com
Thu Jul 1 08:58:40 MSD 2010

I am very new to nginx, Any hints?

You can check the test page at

As you can see at bottom of this page there are no header related _SERVER

Here is my domain config file:

server {
        server_name scrubly.com;

        location / {
                root   /avinashi/sites/scrubly.com;
                index index.php;

                # if file exists return it right away
                if (-f $request_filename) {

                # otherwise rewrite the fucker
                if (!-e $request_filename) {
                        rewrite ^(.+)$ /index.php$1 last;


        # if the request starts with our frontcontroller, pass it on to
        location ~ ^/(.+).php
                fastcgi_param SCRIPT_FILENAME /avinashi/sites/scrubly.com
                fastcgi_param PATH_INFO $fastcgi_script_name;
                #include /usr/local/nginx/conf/fastcgi_params;

                fastcgi_connect_timeout 60;
                fastcgi_send_timeout 180;
                fastcgi_read_timeout 180;
                fastcgi_buffer_size 128k;
                fastcgi_buffers 4 256k;
                fastcgi_busy_buffers_size 256k;
                fastcgi_temp_file_write_size 256k;
                fastcgi_intercept_errors on;


And here is the nginx.conf

worker_processes  6;

error_log  logs/error.log debug;
#error_log  logs/error.log  notice;
#error_log  logs/error.log  info;

#pid        logs/nginx.pid;

events {
    worker_connections  1024;

http {
    include       mime.types;
    default_type  application/octet-stream;

    log_format  main  '$remote_addr - $remote_user [$time_local] "$request"
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';

    #access_log  logs/access.log  main;

    sendfile        on;
    #tcp_nopush     on;

    keepalive_timeout  0;
    #keepalive_timeout  65;

    gzip  on;
    gzip_comp_level 1;
    gzip_proxied any;
    gzip_types text/plain text/html text/css application/x-javascript
text/xml application/xml application/xml+rss text/javascript;

        include /etc/sites/*;

    server {
        listen       80;
        server_name  localhost;

        #charset koi8-r;

        #access_log  logs/host.access.log  main;

        location / {
            root   html;
            index  index.html index.htm;

        #error_page  404              /404.html;

        # redirect server error pages to the static page /50x.html
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;

Any help would be great!


Ashvin Savani
CEO & Chief Architect,
FlashBrain - A Division of Avinashi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://nginx.org/pipermail/nginx/attachments/20100701/e1a24519/attachment-0001.html>

More information about the nginx mailing list