Rhizome-Conifer / conifer

Collect and revisit web pages.
https://conifer.rhizome.org
Apache License 2.0
1.48k stars 119 forks source link

Reverse proxy configuration? #755

Open ccc2lu opened 4 years ago

ccc2lu commented 4 years ago

I would like to run the Dockerized version of webrecorder on a server at Lehigh University. It's a shared Debian Stretch server though with other web applications that all use Apache 2.4.25 as the web server. I'd like to configure Apache as a reverse proxy for webrecorder, with its own Apache virtual host. Can you share or point to any examples of a reverse proxy configuration for webrecorder? Thanks!

ccc2lu commented 4 years ago

Anyone out there tried this? I remain stuck trying to get it to work.

ikreymer commented 4 years ago

Sorry for late response! The examples we have are nginx based but should certainly be doable with Apache as well.

Our configuration for webrecorder.io uses the Ansible setup available in: https://github.com/webrecorder/webrecorder-deploy

The nginx template config is: https://github.com/webrecorder/webrecorder-deploy/blob/master/templates/wrhost.conf

In general, we run an outer nginx that proxies to the Webrecorder Docker containers. Unfortunately, we don't have time to create an equivalent one for Apache, but would definitely welcome any contributions and happy to answer questions.

We recommend using a different hostname for the app and the content, and have the app proxy to port 8089 while the content hostname forwards to 8092 (The Docker containers run a server on port 8089 and 8092).

ccc2lu commented 4 years ago

Ah, thank you!  This is exactly what I was looking for -- I'll see if I can adapt it to Apache, and if I succeed I'll send along what I come up with.  Thanks again!

-Chris

On 11/5/19 1:40 PM, Ilya Kreymer wrote:

Sorry for late response! The examples we have are nginx based but should certainly be doable with Apache as well.

Our configuration for webrecorder.io uses the Ansible setup available in: https://github.com/webrecorder/webrecorder-deploy

The nginx template config is: https://github.com/webrecorder/webrecorder-deploy/blob/master/templates/wrhost.conf

In general, we run an outer nginx that proxies to the Webrecorder Docker containers. Unfortunately, we don't have time to create an equivalent one for Apache, but would definitely welcome any contributions and happy to answer questions.

We recommend using a different hostname for the app and the content, and have the app proxy to port 8089 while the content hostname forwards to 8092 (The Docker containers run a server on port 8089 and 8092).

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/webrecorder/webrecorder/issues/755?email_source=notifications&email_token=ABJ4M3FRGMQZBZQZS4PV5RDQSG43RA5CNFSM4JDSDU4KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEDD33SA#issuecomment-549961160, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABJ4M3HLEP7J4SLCDMPBQUTQSG43RANCNFSM4JDSDU4A.

-- Christopher Creswell Library and Technology Services Sr. Library Systems Analyst (610) 758-1432 ccc2@lehigh.edu

ccc2lu commented 4 years ago

I'm working my way through this nginx configuration, and there's something I can't seem to figure out.  On line 59 in the "/_websockify" location section, where would the $arg_port variable be getting its value from.  Wouldn't that just be 8089 again?

Thanks,

-Chris

On 11/5/19 1:42 PM, Chris Creswell wrote:

Ah, thank you!  This is exactly what I was looking for -- I'll see if I can adapt it to Apache, and if I succeed I'll send along what I come up with.  Thanks again!

-Chris

On 11/5/19 1:40 PM, Ilya Kreymer wrote:

Sorry for late response! The examples we have are nginx based but should certainly be doable with Apache as well.

Our configuration for webrecorder.io uses the Ansible setup available in: https://github.com/webrecorder/webrecorder-deploy

The nginx template config is: https://github.com/webrecorder/webrecorder-deploy/blob/master/templates/wrhost.conf

In general, we run an outer nginx that proxies to the Webrecorder Docker containers. Unfortunately, we don't have time to create an equivalent one for Apache, but would definitely welcome any contributions and happy to answer questions.

We recommend using a different hostname for the app and the content, and have the app proxy to port 8089 while the content hostname forwards to 8092 (The Docker containers run a server on port 8089 and 8092).

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/webrecorder/webrecorder/issues/755?email_source=notifications&email_token=ABJ4M3FRGMQZBZQZS4PV5RDQSG43RA5CNFSM4JDSDU4KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEDD33SA#issuecomment-549961160, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABJ4M3HLEP7J4SLCDMPBQUTQSG43RANCNFSM4JDSDU4A.

-- Christopher Creswell Library and Technology Services Sr. Library Systems Analyst (610) 758-1432 ccc2@lehigh.edu

-- Christopher Creswell Library and Technology Services Sr. Library Systems Analyst (610) 758-1432 ccc2@lehigh.edu

ikreymer commented 4 years ago

That variable is query parameter, nginx defines these $arg_NAME implicitly for every query param NAME.

The endpoint is designed to forward remote browser traffic from /_websockify?port=<PORT> to local port <PORT> and is only needed for remote browser usage.