rails-lambda / lamby-cookiecutter

🐑🛤 AWS SAM Cookiecutter to Quick Start Rails & Lambda
https://lamby.cloud/docs/quick_start
37 stars 18 forks source link

nginx #29

Closed hopewise closed 1 year ago

hopewise commented 1 year ago

Hello

My rails app is currently running behind nginx, as I use some rules to proxy pass some locations so that they appear within my rails app urls, ex: myapp.com/forum which is proxy passed to discourse EC2 instance.

I can add a separate EC2 instance to use nginx as a proxy to my lambda url and have my rails container runs without nginx, however that will cost me extra ec2 server.

The question is, can I use lamby to point traffic to nginx instead of directly into my rails app in my container?

metaskills commented 1 year ago

This question should be on the Lamby repo vs the cookiecutter starter project. That said, adding NGINX in the way you described is not going to be easy or serve you well. Here is what I suggest.

Lamby.config.rack_app = Rack::Builder.new do
  map '/forum' do
    run Rails.application
  end
end.to_app

I should cover this in the advanced configs issue:

hopewise commented 1 year ago

Thank you