Skip to content

Instantly share code, notes, and snippets.

@mavelar
Last active December 29, 2017 02:40
Show Gist options
  • Select an option

  • Save mavelar/4608636a66382f50260f to your computer and use it in GitHub Desktop.

Select an option

Save mavelar/4608636a66382f50260f to your computer and use it in GitHub Desktop.
railo.conf, is a CFML / nginx connector, can be used by Railo or Lucee on any OS.
location / {
try_files $uri $uri/ @rewrites;
}
location @rewrites {
# Can put some of your own rewrite rules in here
# for example rewrite ^/~(.*)/(.*)/? /users/$1/$2 last;
rewrite ^/(.*)? /index.cfm/$1 last;
rewrite ^ /index.cfm last;
}
location ~* /lucee/admin/ {
internal;
proxy_pass http://127.0.0.1:8888;
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;
}
location ~* /lucee/administrator/ {
rewrite ^/lucee/administrator/(.*)? /lucee/admin/$1;
}
# Main Railo proxy handler
location ~ \.(cfm|cfml|cfc|jsp|cfr)(.*)$ {
proxy_pass http://127.0.0.1:8888;
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-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment