转:nginx 官方drupal 配置 - Drupal | NGINX
#参考:nginx 官方drupal 配置 - Drupal | NGINX server {
server_name example.com;
root /var/www/drupal8; ## <-- Your only path reference. 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/;
deny all;
} location ~ \..*/.*\.php$ {
return ;
} location ~ ^/sites/.*/private/ {
return ;
} # Block access to scripts in site files directory
location ~ ^/sites/[^/]+/files/.*\.php$ {
deny all;
} # Allow "Well-Known URIs" as per RFC
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 ;
} location / {
# try_files $uri @rewrite; # For Drupal <=
try_files $uri /index.php?$query_string; # For Drupal >=
} location @rewrite {
rewrite ^/(.*)$ /index.php?q=$;
} # Don't allow direct access to PHP files in the vendor directory.
location ~ /vendor/.*\.php$ {
deny all;
return ;
} # In Drupal , we must also match new paths where the '.php' appears in
# the middle, such as update.php/selection. The rule we use is strict,
# and only allows this pattern with the update.php front controller.
# This allows legacy path aliases in the form of
# blog/index.php/legacy-path to continue to route to Drupal nodes. If
# you do not have any paths like that, then you might prefer to use a
# laxer rule, such as:
# location ~ \.php(/|$) {
# The laxer rule will continue to work if Drupal uses this new URL
# pattern with front controllers other than update.php in a future
# release.
location ~ '\.php$|^/update.php' {
fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
# Security note: If you're running a version of PHP older than the
# latest 5.3, you should have "cgi.fix_pathinfo = 0;" in php.ini.
# See http://serverfault.com/q/627903/94922 for details.
include fastcgi_params;
# Block httpoxy attacks. See https://httpoxy.org/.
fastcgi_param HTTP_PROXY "";
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param QUERY_STRING $query_string;
fastcgi_intercept_errors on;
# PHP socket location.
#fastcgi_pass unix:/var/run/php5-fpm.sock;
# PHP socket location.
fastcgi_pass unix:/var/run/php/php7.-fpm.sock;
} # Fighting with Styles? This little gem is amazing.
# location ~ ^/sites/.*/files/imagecache/ { # For Drupal <=
location ~ ^/sites/.*/files/styles/ { # For Drupal >=
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 >=
try_files $uri /index.php?$query_string;
} location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
try_files $uri @rewrite;
expires max;
log_not_found off;
}
}
转:nginx 官方drupal 配置 - Drupal | NGINX的更多相关文章
- CentOS下nginx+php的配置及nginx开机启动配置
关闭防火墙 (不然外链接是访问不了 apache) service iptables stop 关闭安全系统 SELinux( 不然报403 访问页面错误 ) 1.Nginx安装主要在于配置文件的修改 ...
- nginx之旅(第三篇):代理、正向代理、反向代理、代理的原理、nginx反向代理场景、nginx反向代理配置、nginx反向代理语法
一.代理服务与反向代理 什么是代理服务 代理-代理办理(代理理财.代理收货.代理购物等等). 一般情况下,如果没有特别说明,代理技术默认说的是正向代理技术.关于正向代理的概念如下: 正向代理(forw ...
- nginx反向代理配置(nginx.conf+proxy_set_header)
转载:https://blog.csdn.net/bjsunwei/article/details/62231209 location / { proxy_pass http://test; prox ...
- nginx 多域名配置 (nginx如何绑定多个域名)
nginx绑定多个域名可又把多个域名规则写一个配置文件里,也可又分别建立多个域名配置文件,我一般为了管理方便,每个域名建一个文件,有些同类域名也可又写在一个总的配置文件里. 一.每个域名一个 ...
- 隔壁小孩都要知道的Drupal配置
i春秋作家:Arizona 原文来自:隔壁小孩都要知道的Drupal配置 隔壁小孩都要知道的Drupal配置 Drupal是一个开源的PHP内容管理系统,具有相当复杂的架构.它还具有强大的安全模型.感 ...
- Nginx详解七:Nginx基础篇之Nginx官方模块
Nginx官方模块 --with-http_stub_status_module:Nginx的客户端状态,用于监控连接的信息,配置语法如下:配置语法:stub_status;默认状态:-配置方法:se ...
- CentOS 8 下 nginx 服务器安装及配置笔记
参考文档 nginx官方文档 安装 在CentOS下,nginx官方提供了安装包可以安装 首先先安装前置软件 sudo yum install yum-utils 然后将nginx官方源加入到yum源 ...
- Nginx安装与配置-Centos7
Nginx是一款高性能免费开源网页服务器,也可用于反向代理和负载均衡服务器.该软件由伊戈尔·赛索耶夫于2004年发布,2019年3月11日,Nginx被F5 Networks以6.7亿美元收购.201 ...
- Nginx Gzip 压缩配置
Nginx Gzip 压缩配置 随着nginx的发展,越来越多的网站使用nginx,因此nginx的优化变得越来越重要,今天我们来看看nginx的gzip压缩到底是怎么压缩的呢? gzip(GNU-Z ...
随机推荐
- javascript 易错知识点合集
为什么 typeof null === 'object' 原理是这样的,不同的对象在底层都表示为二进制,在JavaScript中二进制前三位都为0的话会被判断为 object 类型, null 的二进 ...
- PHP之旅3 php数组以及遍历数组 以及each() list() foreach()
php的数组的定义 <?php //php中定义数组时可以通过索引直接进行赋值: $mArr[0]="哈哈"; $mArr[1]=70; $mArr[2]='haha'; e ...
- Git 使用流程
# 下载远程仓库到本地 git clone 仓库地址cd 本地仓库文件夹 # 创建本地开发分支并与远程开发分支关联 git checkout -b develop origin/developgit ...
- POJ 1036
#include<iostream> #include<algorithm> #define MAXN 205 using namespace std; struct node ...
- 一文详解python的类方法,普通方法和静态方法
首先形式上的区别,实例方法隐含的参数为类实例self,而类方法隐含的参数为类本身cls. 静态方法无隐含参数,主要为了类实例也可以直接调用静态方法. 所以逻辑上,类方法被类调用,实例方法被实例调用,静 ...
- 代码阅读——十个C开源项目
1. Webbench Webbench是一个在linux下使用的非常简单的网站压测工具.它使用fork()模拟多个客户端同时访问我们设定的URL,测试网站在压力下工作的性能,最多可以模拟3万个并发连 ...
- ugui使用自带功能实现反向遮罩
不需要编写额外的shader和任何代码,只使用自带的功能 新建一个材质球,取名为mask,选择自带的UI/Default,调节参数如下图 再新建一个材质球,取名为masked,调节参数如下图 如下图所 ...
- Nodejs学习笔记(十六)—Pomelo介绍&入门
前言&介绍 Pomelo:一个快速.可扩展.Node.js分布式游戏服务器框架 从三四年前接触Node.js开始就接触到了Pomelo,从Pomelo最初的版本到现在,总的来说网易出品还算不错 ...
- rem手机端适配
<script> document.documentElement.style.fontSize=document.documentElement.clientWidth*100/750+ ...
- 转载:哈希加密算法 MD5,SHA-1,SHA-2,SHA-256,SHA-512,SHA-3,RIPEMD-160 - aTool
http://www.atool.org/hash.php 一.MD5哈希加密算法 MD5即Message-Digest Algorithm 5(信息-摘要算法 5),用于确保信息传输完整一致.是计算 ...