Skip to content

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

Merged
aantron merged 6 commits intocamlworks:masterfrom
jsthomas:issue-98
Jul 22, 2021
Merged

Add an example showing how to use nginx as a reverse proxy.#140
aantron merged 6 commits intocamlworks:masterfrom
jsthomas:issue-98

Conversation

@jsthomas
Copy link
Copy Markdown
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
Copy Markdown
Collaborator

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!

Copy link
Copy Markdown
Collaborator

@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).

@jsthomas
Copy link
Copy Markdown
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 camlworks:master Jul 22, 2021
@aantron
Copy link
Copy Markdown
Collaborator

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

Development

Successfully merging this pull request may close these issues.

2 participants