the installer doesn’t set up your web server AFAIK. you need to
configure nginx to forward the .cfm requests to Lucee by defining an
upstream and forwarding the requests with the proxy_pass directive.
Thanks for the response. Can you provide some instruction as to how to do
this. My website config file points to a lucee config file… is there
more to do? Below is an example of a test config file. If the root
document is index.html it works fine. However, index.cfm triggers the 502
bad gate way error…
server {
listen 307;
server_name test.com;
root /web/test.com/wwwroot/;
# Mod_cfml (Lucee) specific: add a unique ID for this server block.
# For more info, see
http://www.modcfml.org/index.cfm/install/web-server-components/nginx-all-os/
set $lucee_context "example.com";
include lucee.conf;
}
location ~* /lucee/ {
allow 192.168.1.116;
deny all;
include lucee-proxy.conf;
}
location ~* /lucee-server {
return 404;
}
#block/ignore CFIDE requests
location ~* /CFIDE {
return 404;
}
#block requests for Application.cfc/cfm
location ~* Application.cf[mc]$ {
return 404;
}
#match cfm or cfc files and proxy them off to tomcat
#if you do not need SES urls like index.cfm/foo/bar
#then use: (\.cfm|\.cfc)$ instead
location ~* (\.cfm(\/|$)|\.cfc$) {
include lucee-proxy.conf;
}
#set the default document to index.html or index.cfm
index index.html index.cfm;
No. Mod_cfml doesn’t touch the server.xml file. The server.xml file adds your contexts to Tomcat during Tomcat’s bootup, where mod_cfml adds contexts to Tomcat on-the-fly.–
Kind regards,
Jordan Michaels
Vivio Technologies
I’ve had some progress. I’ve included the config files for a site
(test.com). Although still get 502 Bad Gateway it appears that Lucee has
created the WEB-INF folder in the root.
Didn’t you say your lucee install was on 8888? If so, your
lucee-proxy.conf should have 127.0.0.1:8888, not 8080. (Which is also what
I’m seeing in your server.xml. The 8080 connector is commented out)
Now, time to hand off to someone who uses mod_cfml
My expectation is you have some proxy headers to set in lucee-proxy.
There’s an example on modcfml.org, and I feel like the mod_cfml valve in
Tomcat might need a password or header or something.
But I guess the first question is, do you actually need mod_cfml? Do you
have multiple vhosts on your server or do you need multiple web contexts?
If not, going without mod_cfml is possible.
-G
An example of the specific header you need to fix that error can be found in this example NGINX config:
The shared key is a key that authorizes your web server (whether it’s NGINX, Apache, IIS, or whatever) to send new contexts to the mod_cfml Tomcat valve. This shared key must match the shared key you have in your server.xml file. In your C:\lucee\tomcat\conf\server.xml file, there will be an entry like this:
<!-- visit modcfml.org for details on mod_cfml configuration options -->
<Valve className="mod_cfml.core"
loggingEnabled="false"
maxContexts="200"
timeBetweenContexts="2000"
scanClassPaths="false"
sharedKey="9470da36d3fba9f62b-BoatloadsOfOtherRandomLettersAndNumbers-789f6449a11f2bc"
/>
Note the “sharedKey” value. The shared key in your NGINX config and the shared key in your server.xml config must match.
Hope this helps!–
Kind regards,
Jordan Michaels
Vivio Technologies