Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nginx #29

Closed
hopewise opened this issue Jan 15, 2023 · 2 comments
Closed

nginx #29

hopewise opened this issue Jan 15, 2023 · 2 comments

Comments

@hopewise
Copy link

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
Copy link
Member

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.

  • If you have extra headers needed for your Rack app, perhaps add a Rack middleware in your Rails app that ads them for you. I think Rails even has a config for this too that most folks use in production.rb?
  • If you need a relative URL root, consider using the new rack_app= setter to configure this as needed. For example:
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
Copy link
Author

Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants