foundeo / ubuntu-nginx-lucee

Script for standing up a Lucee server using nginx and Tomcat on Ubuntu
Apache License 2.0
86 stars 47 forks source link

Proxy for SES locations #16

Closed dswitzer closed 7 years ago

dswitzer commented 7 years ago

I've created a fork of this project for CentOS. I've got a couple of improvements, but unfortunately I've had to make a lot of changes due to the differences between CentOS and Ubuntu.

I'm going to try to fork the project and migrate my fixes to both repos.

In the meantime, I did discover a bug in the SES routing, see this change:

https://github.com/dswitzer/centos7-nginx-lucee/commit/075ca1836bbb3db1a68a5d075c9e16f9e9c928ed

The problem is in the etc/nginx/lucee.conf file. The proxy is only loaded if the script ends in .cfm or .cfc, so if you have URLs like /index.cfm/ses/safe/urls/ the proxy is never loaded, so the URL rewrite rule is never applied.

The fix I came up with is pretty simple

#match cfm or cfc files and proxy them off to tomcat
location ~* (\.cfm(\/|$)|\.cfc$) {
  include lucee-proxy.conf;
}

Basically the proxy is loaded if the template ends in .cfm or matches the pattern .cfm/.