Online looking for a long time no right, back directly in Http://wiki.nginx.org/Drupal
To find the original text. But the original copy comes up with a ' root ' rewrite directive is duplicate error and the server first column error.
Compared to the pre-set rewrite found on Aliyun, they do not have the name of the server {}, and this location is also wrong in the nginx-t times.
Staring at the location of the error, removed the configuration that does not apply to Drupal 7 or less.
- /alidata/server/nginx/sbin/nginx-t
Set it up with this test.
Finally, the Conf file is also set and restarted.
- /alidata/server/nginx/sbin/nginx-s Reload
with the original configuration:
server_name domain.tld; #root/var/www/drupal7; # # <--Your only path reference. # Enable compression, this would help if you have a for instance Advagg? Module # by serving Gzip versions of the files. Gzip_static on; Location =/favicon.ico {log_not_found off; Access_log off; } location =/robots.txt {Allow all; Log_not_found off; Access_log off; } # This matters if your use drush prior to 5.x # After 5.x backups is stored outside the Drupal install. #location =/backup {# deny all; #} # 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; } # 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/{# This is cool because no PHP are touched for static content Try_files $uri @rewrite; The location @rewrite {# are 2 options here # D7 and above: # Clean URLs is handled in Drupal_environment_initialize (). rewrite ^/index.php; # for Drupal 6 and Bwlow: # Some modules enforce no slash (/) at the end of the URL # Else T His rewrite block wouldn ' t is needed (globalredirect) #rewrite ^/(. *) $/index.php?q=$1; } location ~ \.php$ {fastcgi_split_path_info ^ (. +\.php) (/.+)$; #NOTE: You should has "cgi.fix_pathinfo = 0;" in php.ini include Fastcgi_params; Fastcgi_param script_filename $request _filename; Fastcgi_intercept_errors on; Fastcgi_pass Unix:/tmp/phpfpm.sock; } # fighting with Styles? This little gem is amazing. # This was for D6 #location ~ ^/sites/.*/files/imagecache/{# This was for D7 and D8 location ~ ^/site s/.*/files/styles/{try_files $uri @rewrite; } location ~* \. (Js|css|png|jpg|jpeg|gif|ico) $ {expires Max; Log_not_found off; }}
Aliyun host Nginx configuration Drupal pseudo-static