Skip to content

Instantly share code, notes, and snippets.

@mjhagen
Last active July 15, 2016 10:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mjhagen/851e4758bd200d5d0333d099236654c0 to your computer and use it in GitHub Desktop.
Save mjhagen/851e4758bd200d5d0333d099236654c0 to your computer and use it in GitHub Desktop.
Debian/Tomcat/Lucee/FW1 Config File
server {
listen 80;
server_name example.com;
root /path-to-tomcat-ROOT/path-to-webroot/;
access_log /var/log/nginx/example.com-access.log;
error_log /var/log/nginx/example.com-error.log;
index index.html index.cfm;
location / {
try_files $uri $uri/ /path-to-webroot/index.cfm$request_uri;
}
location ~* (\.cfm|\.cfc) {
proxy_pass http://127.0.0.1:8888;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
set $pathinfo "";
if ( $uri ~ "^(.+?\.cf[mc])(/.*)" ) {
set $script $1;
set $pathinfo $2;
rewrite ^.+$ $script break;
}
proxy_set_header XAJP-PATH-INFO $pathinfo;
}
location ^~ /lucee {
deny all;
}
location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt { access_log off; log_not_found off; }
location ~ /\. { deny all; access_log off; log_not_found off; }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment