Commit f847beaf authored by memtkmcc's avatar memtkmcc Committed by memtkmcc

Issue #2820747 by memtkmcc: Nginx - Support for Accelerated Mobile Pages (AMP)

parent aebbb49b
......@@ -1185,12 +1185,23 @@ location @drupal {
<?php if ($nginx_config_mode == 'extended'): ?>
###
### Send all known bots to $args free URLs.
### Special location for bots custom restrictions; can be overridden.
###
location @nobots {
if ($is_bot) {
return 301 $scheme://$host$request_uri;
###
### Support for Accelerated Mobile Pages (AMP).
###
if ( $query_string ~ "^amp$" ) {
rewrite ^/(.*)$ /index.php?q=$1 last;
}
###
### Send all known bots to $args free URLs (optional)
###
# if ($is_bot) {
# return 301 $scheme://$host$request_uri;
# }
###
### Return 404 on special PHP URLs to avoid revealing version used,
### even indirectly. See also: https://drupal.org/node/2116387
......
......@@ -1151,12 +1151,23 @@ location @drupal_<?php print $subdir_loc; ?> {
<?php if ($nginx_config_mode == 'extended'): ?>
###
### Send all known bots to $args free URLs.
### Special location for bots custom restrictions; can be overridden.
###
location @nobots_<?php print $subdir_loc; ?> {
if ($is_bot) {
return 301 $scheme://$host$request_uri;
###
### Support for Accelerated Mobile Pages (AMP).
###
if ( $query_string ~ "^amp$" ) {
rewrite ^/<?php print $subdir; ?>/(.*)$ /<?php print $subdir; ?>/index.php?q=$1 last;
}
###
### Send all known bots to $args free URLs (optional)
###
# if ($is_bot) {
# return 301 $scheme://$host$request_uri;
# }
###
### Return 404 on special PHP URLs to avoid revealing version used,
### even indirectly. See also: https://drupal.org/node/2116387
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment