We are happy to announce that Vesta is back under active development as of 25 February 2024. We are working on v1 candidate and expect to engage more with the community over the coming months. We are committed to open source, and we encourage contributors to help us build the future of Vesta.
Drupal 7 does not generate styles using clean urls on Ubuntu 16.04 NGINX/PHP-FPM
Drupal 7 does not generate styles using clean urls on Ubuntu 16.04 NGINX/PHP-FPM
I cannot get it to work, i have a fresh Vesta installation on Ubuntu 16.04 and NGINX + php-fpm web server.
Created a web with nginx template "drupal 7" and backend template "default".
Install a fresh Drupal 7, add an article with an image and view the recently created article. The browser returns error 404 not found image. Drupal does not log any errors nor does nginx logs.
I've tried to change folder permissions and the problem persists.
I've tried to change nginx.conf
from
to
reload the configuration and restarted the server and the problem persist.
Edited:
Drupal 7 without Clean URL works and I can confirm that has nothing to do with folder permissions.
Anyone has the same issue?
Created a web with nginx template "drupal 7" and backend template "default".
Install a fresh Drupal 7, add an article with an image and view the recently created article. The browser returns error 404 not found image. Drupal does not log any errors nor does nginx logs.
I've tried to change folder permissions and the problem persists.
I've tried to change nginx.conf
from
Code: Select all
location ~ ^/sites/.*/files/styles/ {
try_files $uri @rewrite;
}
Code: Select all
location ~* /sites/.*/files/styles/ {
access_log off;
expires 30d;
try_files $uri @rewrite;
}
Edited:
Drupal 7 without Clean URL works and I can confirm that has nothing to do with folder permissions.
Anyone has the same issue?
Re: Drupal 7 does not generate styles using clean urls on Ubuntu 16.04 NGINX/PHP-FPM
I found the solution and works, this needs to be updated into Vesta nginx templates!!
Based on NGINX https://www.nginx.com/resources/wiki/st ... es/drupal/ updated Drupal recipes i've adapted the Drupal 7 NGINX template as follows:
Based on NGINX https://www.nginx.com/resources/wiki/st ... es/drupal/ updated Drupal recipes i've adapted the Drupal 7 NGINX template as follows:
Code: Select all
location = /favicon.ico {
log_not_found off;
access_log off;
}
location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}
# Very rarely should these ever be accessed outside of your lan
location ~* \.(txt|log)$ {
allow 192.168.0.0/16;
deny all;
}
location ~ \..*/.*\.php$ {
return 403;
}
# No no for private
location ~ ^/sites/.*/private/ {
return 403;
}
# Allow "Well-Known URIs" as per RFC 5785
location ~* ^/.well-known/ {
allow all;
}
# Block access to "hidden" files and directories whose names begin with a
# period. This includes directories used by version control systems such
# as Subversion or Git to store control files.
location ~ (^|/)\. {
return 403;
}
location / {
# try_files $uri @rewrite; # For Drupal <= 6
try_files $uri /index.php?$query_string; # For Drupal >= 7
}
location @rewrite {
rewrite ^/(.*)$ /index.php?q=$1;
}
# Don't allow direct access to PHP files in the vendor directory.
location ~ /vendor/.*\.php$ {
deny all;
return 404;
}
location ~ [^/]\.php(/|$) {
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
if (!-f $document_root$fastcgi_script_name) {
return 404;
}
fastcgi_pass 127.0.0.1:9002;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $request_filename;
fastcgi_intercept_errors on;
include /etc/nginx/fastcgi_params;
}
# Fighting with Styles? This little gem is amazing.
# location ~ ^/sites/.*/files/imagecache/ { # For Drupal <= 6
location ~ ^/sites/.*/files/styles/ { # For Drupal >= 7
try_files $uri @rewrite;
}
# Handle private files through Drupal. Private file's path can come
# with a language prefix.
location ~ ^(/[a-z\-]+)?/system/files/ { # For Drupal >= 7
try_files $uri /index.php?$query_string;
}
location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
expires max;
log_not_found off;
}