0

I have a wordpress copy on nginx on my localhost. when I wants to open it with browser, the browser just downloads a php file and does not open the site. my /etc/nginx/nginx.conf file cotains:

user  nginx;
worker_processes  1;

error_log  /var/log/nginx/error.log;

pid        /run/nginx.pid;


events {
    worker_connections  1024;
}


http {
    include       /etc/nginx/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  /var/log/nginx/access.log  main;

    sendfile        on;

    keepalive_timeout  65;


    include /etc/nginx/conf.d/*.conf;
    include /etc/nginx/sites-enabled/*;



    index   index.html index.htm;

    server {
        listen       80;
        server_name  localhost;
        root         /usr/share/nginx/html;

        location / {

        }

        error_page  404              /404.html;
        location = /40x.html {
        }
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
        }  
    }
}

What is the problem?

4

1 Answer 1

0

Try to change this line:

default_type application/octet-stream;

to default_type text/html;

Might be your php-script does not set a content MIME type and it goes from nginx.

1
  • kindly tell the reason for downvote Jul 8, 2014 at 13:16

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .