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

Add an example showing how to use nginx as a reverse proxy. #140

Merged
merged 6 commits into from Jul 22, 2021

Conversation

jsthomas
Copy link
Contributor

This change addresses Issue #98 by adding a new example showing how to use nginx as a reverse proxy together with Dream. To simplify setup, both nginx and the example server run in docker containers managed by docker compose. In the example, we show how to use nginx to handle requests for static assets so that that traffic never reaches the application server.

Issue #98 mentions security concerns around respecting proxy headers. The example introduced here doesn't cover those concerns so it won't allow #98 to be closed but may serve as a useful starting point for running those kinds of tests in the future.

@aantron
Copy link
Owner

aantron commented Jul 21, 2021

Thanks! I just started an nginx branch locally but didn't actually get anything done yet, because of preemption by other tasks. I will review this shortly. It's fine to consider having an nginx example as closing #98#10 is the issue about trusting/reading the proxy's headers, and solving #10 at least for nginx will be made considerably easier by having this example!

example/README.md Outdated Show resolved Hide resolved
example/w-nginx/README.md Show resolved Hide resolved
example/w-nginx/README.md Show resolved Hide resolved
example/w-nginx/README.md Show resolved Hide resolved
example/w-nginx/default.conf Outdated Show resolved Hide resolved
example/w-nginx/nginx.conf Show resolved Hide resolved
Copy link
Owner

@aantron aantron left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, looks good now! Thanks!

Apart from the two nits, the main remaining question is: do we have license/usage and source information for the OCaml logo used in this example?

By comparison, example w-one-binary uses a silly picture of OCaml, and "serves" together with it a README.md that says:

The camel image is taken from pixabay.com. The license
states:

Free for commercial use

No attribution required

Since we don't have a separate directory in this example to put a README in, we could just put the corresponding info for the OCaml logo into a different file (or make an assets directory like in w-one-binary).

example/w-nginx/README.md Outdated Show resolved Hide resolved
example/w-nginx/README.md Outdated Show resolved Hide resolved
@jsthomas
Copy link
Contributor Author

I've added license_info.md to explain how the logo used in the example is licensed.

@aantron aantron merged commit b8befbb into aantron:master Jul 22, 2021
@aantron
Copy link
Owner

aantron commented Jul 22, 2021

Thanks!

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

Successfully merging this pull request may close these issues.

None yet

2 participants