helpcenter/Web/Controls/Help/Server/Document/DocServerProxy/DocServerProxy.ascx

65 lines
5.7 KiB
Plaintext

<%@ Control Language="C#" Inherits="BaseContentUserControls"%>
<%@ Register Namespace="TeamLab.Controls" Assembly="__Code" TagPrefix="cc" %>
<script runat="server">
protected override void Init()
{
PageTitle = PageCaption = "Using ONLYOFFICE Docs behind the proxy";
MetaKeyWords = "";
MetaDescription = "Learn how to use ONLYOFFICE Docs behind the proxy";
}
</script>
<div class="main_buscall_container dataBackup">
<div class="MainHelpCenter">
<h1 class="subHeaderFeaturesCaption TipsCaption">Using ONLYOFFICE Docs behind the proxy</h1>
<cc:localizecontent runat="Server" controlname="~/Controls/Help/VariousControls/Versions/DocumentServer/DocumentServer_Current.ascx" />
<div class="keyword_block">
<ul>
<li><cc:LocalizeContent runat="Server" ControlName="~/Controls/Help/Tags/local-server/local-server.ascx" /></li>
<li><cc:LocalizeContent runat="Server" ControlName="~/Controls/Help/Tags/server-version/server-version.ascx" /></li>
<li><cc:LocalizeContent runat="Server" ControlName="~/Controls/Help/Tags/document-server/document-server.ascx" /></li>
</ul>
</div>
<h2 id="Intro">Introduction</h2>
<p><b>ONLYOFFICE Docs</b> is running as online application and often needs to be integrated into internal networks. Many networks use different web servers as proxy for certain purposes today. Thus it is important to make <b>ONLYOFFICE Docs</b> workable behind the proxy. The most widespread web servers are <a target="_blank" href="http://nginx.org/">NGINX</a> and <a target="_blank" href="https://httpd.apache.org/">Apache</a> which popularity is caused by their flexibility, speed and power. Another well-known web server is <a target="_blank" href="http://www.haproxy.org/">HAProxy</a> which was originally designed to work as a load balancer. In the article below we offer ready examples to configure running <b>ONLYOFFICE Docs</b> behind these three proxy web servers.</p>
<p>To make <b>ONLYOFFICE Docs</b> accessible for client-side hosts you need to set up forwarded HTTP headers. Their aim is to keep information about the client while the request goes to the server through the proxy. You need to set up two types of HTTP headers: <code>X-Forwarded-Proto</code> and <code>X-Forwarded-Host</code>. <b>X-Forwarded-Proto</b> header is a de-facto standard header for identifying the protocol (HTTP or HTTPS) that a client used to connect to the proxy or load balancer. <b>X-Forwarded-Host</b> is a standard header for identifying the original host requested by the client in the Host HTTP request header.</p>
<p>There can be three main scenarios when you need to configure proxy. Here are the examples how it can be performed.</p>
<h2 id="Proxy2Local">Common scenario (proxy to local server)</h2>
<p>This scenario is used when you need to simply redirect the outbound traffic to the local server:</p>
<p>
<img src="<%=VirtualPathUtility.ToAbsolute("~/images/Help/proxy1.jpg")%>" />
</p>
<p>Here are the ready configurations for proxy:</p>
<ul>
<li><a target="_blank" href="https://github.com/ONLYOFFICE/document-server-proxy/blob/master/nginx/minimal.conf">NGINX</a></li>
<li><a target="_blank" href="https://github.com/ONLYOFFICE/document-server-proxy/blob/master/apache/minimal.conf">Apache</a></li>
<li><a target="_blank" href="https://github.com/ONLYOFFICE/document-server-proxy/tree/master/haproxy/minimal.cfg">HAProxy</a></li>
<li><a target="_blank" href="https://github.com/ONLYOFFICE/document-server-proxy/tree/master/traefik/minimal.toml">Træfik</a></li>
</ul>
<h2 id="HTTPS2HTTP">Proxy HTTPS to HTTP</h2>
<p>This scenario is used when you need to secure the connection so all the requests must be automatically redirected to HTTPS:</p>
<p>
<img src="<%=VirtualPathUtility.ToAbsolute("~/images/Help/proxy2.jpg")%>" />
</p>
<p>Here are the ready configurations for proxy:</p>
<ul>
<li><a target="_blank" href="https://github.com/ONLYOFFICE/document-server-proxy/blob/master/nginx/proxy-https-to-http.conf">NGINX</a></li>
<li><a target="_blank" href="https://github.com/ONLYOFFICE/document-server-proxy/blob/master/apache/proxy-https-to-http.conf">Apache</a></li>
<li><a target="_blank" href="https://github.com/ONLYOFFICE/document-server-proxy/tree/master/haproxy/proxy-https-to-http.cfg">HAProxy</a></li>
<li><a target="_blank" href="https://github.com/ONLYOFFICE/document-server-proxy/tree/master/traefik/proxy-https-to-http.toml">Træfik</a></li>
</ul>
<h2 id="VirtualPath">Virtual path</h2>
<p>This is a suitable scenario when you need to map some directory on your host to the path specified in the web server:</p>
<p>
<img src="<%=VirtualPathUtility.ToAbsolute("~/images/Help/proxy3.jpg")%>" />
</p>
<p>Here are the ready configurations for proxy:</p>
<ul>
<li><a target="_blank" href="https://github.com/ONLYOFFICE/document-server-proxy/blob/master/nginx/proxy-to-virtual-path.conf">NGINX</a></li>
<li><a target="_blank" href="https://github.com/ONLYOFFICE/document-server-proxy/blob/master/apache/proxy-to-virtual-path.conf">Apache</a></li>
<li><a target="_blank" href="https://github.com/ONLYOFFICE/document-server-proxy/tree/master/haproxy/proxy-to-virtual-path.cfg">HAProxy</a></li>
<li><a target="_blank" href="https://github.com/ONLYOFFICE/document-server-proxy/tree/master/traefik/proxy-to-virtual-path.toml">Træfik</a></li>
</ul>
</div>
</div>