Welcome! Log In Create A New Profile

Advanced

Drupal 7 and Coldfusion Proxy

Jeremiah Brock
June 14, 2016 11:04AM
Good morning everyone!

I have an issue that I am hoping is just a simple error on my part and
the collective wisdom of the gurus here might solve it.

My setup : RHEL 7, Nginx 1.10, PHP 7 and Drupal 7

My issue : trying to serve seamless paths for both Drupal and
ColdFusion without having to specify every possible path that coldfusion
applications exist in. I was hoping index.cfm would be automatically used
via the index parameters but apparently only when try_files contains
$uri/. However that breaks drupal paths that aren't physical folders...

The following config works - but as you can see the regex listing for
coldfusion application paths is less than stellar...

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

location / {
try_files $uri /index.php?$query_string; # For Drupal >= 7
}

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

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

location ~* \.php$ {
##
# Fastcgi cache
##
set $skip_cache 1;
if ($cache_uri != "null cache") {
add_header X-Cache-Debug "$cache_uri $cookie_nocache
$arg_nocache$arg_comment $http_pragma $http_authorization";
set $skip_cache 0;
}
fastcgi_cache_bypass $skip_cache;
fastcgi_cache evcccache;
fastcgi_cache_key $scheme$host$request_uri$request_method;
fastcgi_cache_valid any 5m;
#fastcgi_cache_use_stale updating;
fastcgi_cache_bypass $http_pragma;
fastcgi_cache_use_stale updating error timeout invalid_header http_500;
try_files $uri $uri/ =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
include fastcgi_params;
fastcgi_read_timeout 300;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass unix:/var/run/php-fpm.sock;
fastcgi_intercept_errors on;
}

# ColdFusion Proxy
##################
#find /var/www/drupal -type f -name 'index.cfm' |sed 's#\(.*\)/.*#\1#'
|sort -u
location ~* \.(cfm|cfc)$ {
proxy_pass https://coldfusion_servers;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
proxy_intercept_errors on;
}

location ~*
^(/longpath/someapp|/anotherpath/anotherapp|/yetanotherpath/andanotherapp|anotherapppath/etcapp)
{
proxy_pass https://coldfusion_servers;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
proxy_intercept_errors on;
}

~Jeremy

--
Jeremiah Brock
IT Web, Data and Development Services / Information Security
425-259-8707
jbrock@everettcc.edu
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Drupal 7 and Coldfusion Proxy

Jeremiah Brock June 14, 2016 11:04AM

Re: Drupal 7 and Coldfusion Proxy

Francis Daly June 14, 2016 06:00PM

Re: Drupal 7 and Coldfusion Proxy

Jeremiah Brock June 14, 2016 06:22PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 246
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready