Skip to content

Commit 96dc9cc

Browse files
sopvopdomenkozar
authored andcommittedNov 24, 2016
Document how to serve hydra behind reverse proxy (#423)
1 parent 2f6c2f5 commit 96dc9cc

File tree

1 file changed

+53
-1
lines changed

1 file changed

+53
-1
lines changed
 

Diff for: ‎doc/manual/installation.xml

+53-1
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ dbserver.example.org:*:hydra:hydra:password</screen>
143143

144144
Make sure that the <emphasis>HYDRA_DATA</emphasis> directory
145145
exists and is writable for the user which will run the Hydra
146-
services.
146+
services.
147147
</para>
148148

149149
<para>
@@ -220,6 +220,58 @@ hydra-server</screen>
220220

221221
</section>
222222

223+
<section>
224+
<title> Serving behind reverse proxy </title>
225+
226+
<para>
227+
To serve hydra web server behind reverse proxy like
228+
<emphasis>nginx</emphasis> or <emphasis>httpd</emphasis> some
229+
additional configuration must be made.
230+
</para>
231+
232+
<para>
233+
Edit your <literal>hydra.conf</literal> file in a similar way to
234+
this example:
235+
236+
<screen>
237+
using_frontend_proxy 1
238+
base_uri example.com</screen>
239+
240+
<literal>base_uri</literal> should be your hydra servers proxied URL.
241+
242+
If you are using Hydra nixos module then setting <literal>hydraURL</literal>
243+
option should be enough.
244+
245+
</para>
246+
247+
<para>
248+
249+
If you want to serve Hydra with a prefix path, for example
250+
<ulink>http://example.com/hydra</ulink> then you need to configure your
251+
reverse proxy to pass <literal>X-Request-Base</literal> to hydra, with
252+
prefix path as value.
253+
254+
For example if you are using nginx, then use configuration similar to following:
255+
<screen>
256+
server {
257+
listen 433 ssl;
258+
server_name example.com;
259+
.. other configuration ..
260+
location /hydra/ {
261+
262+
proxy_pass http://127.0.0.1:3000;
263+
proxy_redirect http://127.0.0.1:3000 https://example.com/hydra;
264+
265+
proxy_set_header Host $host;
266+
proxy_set_header X-Real-IP $remote_addr;
267+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
268+
proxy_set_header X-Forwarded-Proto $scheme;
269+
proxy_set_header X-Request-Base /hydra;
270+
}
271+
}</screen>
272+
273+
</para>
274+
</section>
223275
</chapter>
224276

225277
<!--

0 commit comments

Comments
 (0)
Please sign in to comment.