drupal 8 nginx in ubuntu server installation problem

April 24, 2014 2.9k views
I was able to install nginx, php5 and drupal 8 as well. But the site does not see work as expected. You can see this url. And below is nginx config. server { #listen 80; ## listen for ipv4; this line is default and implied #listen [::]:80 default ipv6only=on; ## listen for ipv6 root /usr/share/nginx/www/d8; index index.php index.html index.htm; # Make site accessible from http://localhost/ server_name; location / { # First attempt to serve request as file, then # as directory, then fall back to index.html try_files $uri $uri/ /index.html; # Uncomment to enable naxsi on this location # include /etc/nginx/naxsi.rules } location /doc/ { alias /usr/share/doc/; autoindex on; allow; deny all; } # Only for nginx-naxsi : process denied requests #location /RequestDenied { # For example, return an error code #return 418; #} 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 /usr/share/nginx/www; } location @rewrite { # Drupal in a subdirectory rewrite ^/([^/]*)/(.*)(/?)$ /$1/index.php?q=$2&$args; }
1 Answer
You don't seem to have it set up correctly to run the php files. There's a tutorial on how to get Drupal setup with nginx here:

You should check it out for all the information, but for starters you should add something like the following in your nginx config.

# pass the PHP scripts to FastCGI server
location ~ \.php$ {
# With php5-fpm:
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
by Raj Amal
Here's how to install Drupal with Nginx on an Ubuntu 13.04 VPS.
Have another answer? Share your knowledge.