drupal.conf

# Riverside Fortress security configuration
# Universal locations for drupal

# author: Sergey Serov

# proxy to httpd (todo create @redirect-to-httpd)
################


location =/cron.php {
  allow 1.2.3.4; # Server IP
  deny  all;
  proxy_pass http://127.0.0.1:8037;
  proxy_set_header Host $host;
  proxy_set_header X-Real-IP $remote_addr;
  client_body_in_single_buffer on;
  if ($request_method = POST) {
    access_log /var/www/html/ww_logs/nginx_request_body.log request_body_log;
  }
}

location =/update.php {
  allow 1.2.3.4; # Site maintainer IP
  deny  all;
  proxy_pass http://127.0.0.1:8037;
  proxy_set_header Host $host;
  proxy_set_header X-Real-IP $remote_addr;
  client_body_in_single_buffer on;
  if ($request_method = POST) {
    access_log /var/www/html/ww_logs/nginx_request_body.log request_body_log;
  }  
}

location =/index.php {
  proxy_pass http://127.0.0.1:8037;
  proxy_set_header Host $host;
  proxy_set_header X-Real-IP $remote_addr;
  #client_body_in_single_buffer on;
  if ($request_method = POST) {
    access_log /var/www/html/ww_logs/nginx_request_body.log request_body_log;
  }
}

location / {
  proxy_pass http://127.0.0.1:8037;
  proxy_set_header Host $host;
  proxy_set_header X-Real-IP $remote_addr;
  #client_body_in_single_buffer on;
  if ($request_method = POST) {
    access_log /var/www/html/ww_logs/nginx_request_body.log request_body_log;
  }
}

# drupal image styles
#####################

location ~* /sites/default/files/styles/ {
  try_files $uri @imagestyles;
}

location @imagestyles {
  proxy_pass http://127.0.0.1:8037;
  proxy_set_header Host $host;
  # access_log off;
}