Question

Nginx error 404 at maintainance page - mode Drupal 7

Hello, i am operating a digital ocean droplet with nginx 1.8.1 / drupal 7 site when i updated from Nginx 1.4.6 i see maintenance page for my drupal site not working .Returns 404 not found . So site is down. At var/log/nginx i get this:

“/usr/share/nginx/html/50x.html” failed (2: No such file or directory), client: xx.xx.xxx.xx, server: www.example.com, request: “GET / HTTP/1.1”, upstream: “fastcgi://unix:/var/run/php5-fpm.sock”, host: “www.example.com

i tried also this https://groups.drupal.org/node/256708#comment-824983 but with no luck.

Can you help?

Thanks George

Subscribe
Share

Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hello there, late answear but this is the configuration:

server { listen 80; server_name www.mysite.com; rewrite ^/(.*) https://www.mysite.com/$1 permanent; }

server {

listen 443 ssl;

root /var/www/html/drupal; index index.php index.html index.htm;

server_name www.mysite.com; ssl_certificate /xxxxxxxx ssl_certificate_key /xxxxxxx

error_page 404 = /index.html; error_page 500 502 503 504 /50x.html; location = /50x.html { root /usr/share/nginx/html; }

location = /favicon.ico { log_not_found off; access_log off; }

location = /robots.txt { allow all; log_not_found off; access_log off; }

location ~ …/..php$ { return 403; }

location ~ ^/sites/.*/private/ { return 403; }

location ~ (^|/). { return 403; }

location / { try_files $uri @rewrite; }

location @rewrite { rewrite ^ /index.php; }

location ~ .php$ { fastcgi_split_path_info ^(.+.php)(/.+)$; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $request_filename; fastcgi_intercept_errors on; fastcgi_pass unix:/var/run/php5-fpm.sock;

}

location ~ ^/sites/.*/files/styles/ { try_files $uri @rewrite; }

location ~* .(js|css|png|jpg|jpeg|gif|ico)$ { expires max; log_not_found off; } }

Could you paste here your nginx.conf? It seems like 50x error occurred, so nginx is trying to show you html page with 50x error, but could find the html file. Alternatively, check out Wodby on the Projects page, they provide a simple way to deploy Drupal to your droplets (they also use nginx).