<div dir="ltr">Good morning everyone!<div><br></div><div> 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.</div><div><br></div><div> My setup : RHEL 7, Nginx 1.10, PHP 7 and Drupal 7</div><div><br></div><div> 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...</div><div><br></div><div> The following config works - but as you can see the regex listing for coldfusion application paths is less than stellar...</div><div><br></div><div><div>root /var/www/drupal;</div><div>index index.html index.php index.cfm;</div></div><div><br></div><div><div style="font-size:12.8px">location / {</div><div style="font-size:12.8px"> try_files $uri /index.php?$query_string; # For Drupal >= 7</div><div style="font-size:12.8px">}</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">location @rewrite {</div><div style="font-size:12.8px"> rewrite ^/(.*)$ /index.php?q=$1;</div><div style="font-size:12.8px">}</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">location ~ ^/sites/.*/files/styles/ {</div><div style="font-size:12.8px"> try_files $uri @rewrite;</div><div style="font-size:12.8px">}</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">location ~* \.php$ {</div><div style="font-size:12.8px"> ##</div><div style="font-size:12.8px"> # Fastcgi cache</div><div style="font-size:12.8px"> ##</div><div style="font-size:12.8px"> set $skip_cache 1;</div><div style="font-size:12.8px"> if ($cache_uri != "null cache") {</div><div style="font-size:12.8px"> add_header X-Cache-Debug "$cache_uri $cookie_nocache $arg_nocache$arg_comment $http_pragma $http_authorization";</div><div style="font-size:12.8px"> set $skip_cache 0;</div><div style="font-size:12.8px"> }</div><div style="font-size:12.8px"> fastcgi_cache_bypass $skip_cache;</div><div style="font-size:12.8px"> fastcgi_cache evcccache;</div><div style="font-size:12.8px"> fastcgi_cache_key $scheme$host$request_uri$request_method;</div><div style="font-size:12.8px"> fastcgi_cache_valid any 5m;</div><div style="font-size:12.8px"> #fastcgi_cache_use_stale updating;</div><div style="font-size:12.8px"> fastcgi_cache_bypass $http_pragma;</div><div style="font-size:12.8px"> fastcgi_cache_use_stale updating error timeout invalid_header http_500;</div><div style="font-size:12.8px"> try_files $uri $uri/ =404;</div><div style="font-size:12.8px"> fastcgi_split_path_info ^(.+\.php)(/.+)$;</div><div style="font-size:12.8px"> include fastcgi_params;</div><div style="font-size:12.8px"> fastcgi_read_timeout 300;</div><div style="font-size:12.8px"> fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;</div><div style="font-size:12.8px"> fastcgi_pass unix:/var/run/php-fpm.sock;</div><div style="font-size:12.8px"> fastcgi_intercept_errors on;</div><div style="font-size:12.8px">}</div><div style="font-size:12.8px"><br></div><div style=""><div style=""><span style="font-size:12.8px"># ColdFusion Proxy</span></div><div style=""><span style="font-size:12.8px">##################</span></div><div style=""><span style="font-size:12.8px">#find /var/www/drupal -type f -name 'index.cfm' |sed 's#\(.*\)/.*#\1#' |sort -u</span></div><div style=""><span style="font-size:12.8px">location ~* \.(cfm|cfc)$ {</span></div><div style=""><span style="font-size:12.8px"> proxy_pass <a href="https://coldfusion_servers">https://coldfusion_servers</a>;</span></div><div style=""><span style="font-size:12.8px"> proxy_redirect off;</span></div><div style=""><span style="font-size:12.8px"> proxy_set_header Host $host;</span></div><div style=""><span style="font-size:12.8px"> proxy_set_header X-Forwarded-Host $host;</span></div><div style=""><span style="font-size:12.8px"> proxy_set_header X-Forwarded-Server $host;</span></div><div style=""><span style="font-size:12.8px"> proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;</span></div><div style=""><span style="font-size:12.8px"> proxy_set_header X-Real-IP $remote_addr;</span></div><div style=""><span style="font-size:12.8px"> proxy_intercept_errors on;</span></div><div style=""><span style="font-size:12.8px">}</span></div><div style=""><span style="font-size:12.8px"><br></span></div><div style=""><span style="font-size:12.8px">location ~* ^(/longpath/someapp|/anotherpath/anotherapp|/yetanotherpath/andanotherapp|anotherapppath/etcapp) {</span></div><div style=""><span style="font-size:12.8px"> proxy_pass <a href="https://coldfusion_servers">https://coldfusion_servers</a>;</span></div><div style=""><span style="font-size:12.8px"> proxy_redirect off;</span></div><div style=""><span style="font-size:12.8px"> proxy_set_header Host $host;</span></div><div style=""><span style="font-size:12.8px"> proxy_set_header X-Forwarded-Host $host;</span></div><div style=""><span style="font-size:12.8px"> proxy_set_header X-Forwarded-Server $host;</span></div><div style=""><span style="font-size:12.8px"> proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;</span></div><div style=""><span style="font-size:12.8px"> proxy_set_header X-Real-IP $remote_addr;</span></div><div style=""><span style="font-size:12.8px"> proxy_intercept_errors on;</span></div><div style=""><span style="font-size:12.8px">}</span></div></div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">~Jeremy</div><div><br></div>-- <br><div data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr">Jeremiah Brock<br><span style="font-size:12.8px">IT Web, Data and Development Services / Information Security</span><br></div><div dir="ltr"><a href="tel:425-259-8707" value="+14252598707" target="_blank">425-259-8707</a><br><a href="mailto:jbrock@everettcc.edu" target="_blank">jbrock@everettcc.edu</a></div></div></div></div>
</div></div>