B
B
byulent2016-12-10 06:43:00
Drupal
byulent, 2016-12-10 06:43:00

So how do you set up clean URLs for drupal?

Need to set up clean URLs to use Drupal 8 on nginx server. I found many options for configuration files. They all look different, and I tried different options, but they all didn't work the way I wanted.
Now my config looks like this:

root /var/www/html;

# Add index.php to the list if you are using PHP
index index.html index.htm index.nginx-debian.html index.php;

server_name _;

location / {
    # First attempt to serve request as file, then
    # as directory, then fall back to displaying a 404.
    try_files $uri $uri/ /index.php?$query_string @rewrite;
}

location @rewrite {
    rewrite  ^/(.*)$ /index.php?q=$1;
}

# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000

location ~ \.php(/|$) {

#   try_files $uri $uri/ @rewrite;
    fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
    include /etc/nginx/fastcgi_params;
    fastcgi_pass unix:/var/run/php-fastcgi/php-fastcgi.socket;
    fastcgi_index index.php;
    fastcgi_param SCRIPT_FILENAME /var/www/html$fastcgi_script_name;
}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
#   deny all;
#}
}

So, if you turn to the section, for example, administration at the address of the form index.php/admin, then everything works successfully. However, if the address is accessed /admin, an error is displayed No input file specified.
. What should the configuration look like in order for the URL to be correctly recognized in both cases?
A big request is not to throw ready-made solutions from the Internet into answers!

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question