VPS侦探论坛

 找回密码
 注册
查看: 6594|回复: 5

军哥,lnmp1.2版本drupal8无法使用update.php

[复制链接]
发表于 2016-5-7 23:23:53 | 显示全部楼层 |阅读模式

军哥,lnmp1.2版本drupal8无法使用update.php
就是在更新脚本时,点继续下一步就,无法找到页面,网上讲是drupal8 在ngnix配置问题,
可是若把这个放上去后,显示502错误

  1. server {
  2.     server_name example.com;
  3.     root /var/www/drupal8; ## <-- Your only path reference.

  4.     location = /favicon.ico {
  5.         log_not_found off;
  6.         access_log off;
  7.     }

  8.     location = /robots.txt {
  9.         allow all;
  10.         log_not_found off;
  11.         access_log off;
  12.     }

  13.     # Very rarely should these ever be accessed outside of your lan
  14.     location ~* \.(txt|log)$ {
  15.         allow 192.168.0.0/16;
  16.         deny all;
  17.     }

  18.     location ~ \..*/.*\.php$ {
  19.         return 403;
  20.     }

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

  24.     # Allow "Well-Known URIs" as per RFC 5785
  25.     location ~* ^/.well-known/ {
  26.         allow all;
  27.     }

  28.     # Block access to "hidden" files and directories whose names begin with a
  29.     # period. This includes directories used by version control systems such
  30.     # as Subversion or Git to store control files.
  31.     location ~ (^|/)\. {
  32.         return 403;
  33.     }

  34.     location / {
  35.         # try_files $uri @rewrite; # For Drupal <= 6
  36.         try_files $uri /index.php?$query_string; # For Drupal >= 7
  37.     }

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

  41.     # Don't allow direct access to PHP files in the vendor directory.
  42.     location ~ /vendor/.*\.php$ {
  43.         deny all;
  44.         return 404;
  45.     }

  46.     # In Drupal 8, we must also match new paths where the '.php' appears in the middle,
  47.     # such as update.php/selection. The rule we use is strict, and only allows this pattern
  48.     # with the update.php front controller.  This allows legacy path aliases in the form of
  49.     # blog/index.php/legacy-path to continue to route to Drupal nodes. If you do not have
  50.     # any paths like that, then you might prefer to use a laxer rule, such as:
  51.     #   location ~ \.php(/|$) {
  52.     # The laxer rule will continue to work if Drupal uses this new URL pattern with front
  53.     # controllers other than update.php in a future release.
  54.     location ~ '\.php$|^/update.php' {
  55.         fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
  56.         #NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
  57.         include fastcgi_params;
  58.         fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  59.         fastcgi_param PATH_INFO $fastcgi_path_info;
  60.         fastcgi_intercept_errors on;
  61.         fastcgi_pass unix:/var/run/php5-fpm.sock;
  62.     }

  63.     # Fighting with Styles? This little gem is amazing.
  64.     # location ~ ^/sites/.*/files/imagecache/ { # For Drupal <= 6
  65.     location ~ ^/sites/.*/files/styles/ { # For Drupal >= 7
  66.         try_files $uri @rewrite;
  67.     }

  68.     location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
  69.         expires max;
  70.         log_not_found off;
  71.     }
  72. }
复制代码


军哥,能否看看,这配置文件要怎么写?

[ 本帖最后由 1051386598 于 2016-5-8 11:06 编辑 ]
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2016-5-8 09:22:51 | 显示全部楼层


你发的配置文件没法看,发配置文件用编辑器上的“插入代码”

只检索关键词这个配置文件肯定不行,lnmp的fastcgi_pass 是unix:/tmp/php-cgi.sock; 这个不对肯定502
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2016-5-8 11:08:54 | 显示全部楼层

回复 2# 的帖子


不好意思,主贴已改成插入代码,请军哥帮忙看看,感谢
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2016-5-9 09:10:31 | 显示全部楼层

回复 3# 的帖子




先按2楼改完试试再说
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
发表于 2016-8-5 08:47:04 | 显示全部楼层

碰到同样的问题,试过网上很多帖子的方法,都行不通

军哥运维代购:http://shop63846532.taobao.com/

发表于 2018-10-17 10:18:18 | 显示全部楼层

最后怎么解决的?给个方法呀!谢谢
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|VPS侦探 ( 鲁ICP备16040043号-1 )

GMT+8, 2024-11-19 17:25 , Processed in 0.027008 second(s), 16 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表