<?xml version="1.0" encoding="utf-8" ?>

<rss version="2.0" 
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:admin="http://webns.net/mvcb/"
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
   xmlns:wfw="http://wellformedweb.org/CommentAPI/"
   xmlns:content="http://purl.org/rss/1.0/modules/content/"
   >
<channel>
    
    <title>blog.crox.net (Entries tagged as apache)</title>
    <link>https://blog.crox.net/</link>
    <description></description>
    <dc:language>en</dc:language>
    <generator>Serendipity 2.5.0 - http://www.s9y.org/</generator>
    <pubDate>Wed, 05 Mar 2025 23:25:36 GMT</pubDate>

    <image>
    <url>https://blog.crox.net/templates/2k11/img/s9y_banner_small.png</url>
    <title>RSS: blog.crox.net - </title>
    <link>https://blog.crox.net/</link>
    <width>100</width>
    <height>21</height>
</image>

<item>
    <title>Nextcloud behind reverse proxy - WOPI URL changed from https to http</title>
    <link>https://blog.crox.net/archives/126-Nextcloud-behind-reverse-proxy-WOPI-URL-changed-from-https-to-http.html</link>
    
    <comments>https://blog.crox.net/archives/126-Nextcloud-behind-reverse-proxy-WOPI-URL-changed-from-https-to-http.html#comments</comments>
    <wfw:comment>https://blog.crox.net/wfwcomment.php?cid=126</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>https://blog.crox.net/rss.php?version=2.0&amp;type=comments&amp;cid=126</wfw:commentRss>
    

    <author>nospam@example.com (crox)</author>
    <content:encoded>
    I&#039;m trying out the &quot;Nextcloud Office&quot; app together with &quot;Collabora Online - Built-in CODE Server&quot;. That Nextcloud instance is behind a reverse proxy.&lt;br /&gt;
&lt;br /&gt;
The problem I encountered was that regardless of the &#039;overwritehost&#039; and &#039;overwriteprotocol&#039; settings, the WOPI URL kept being automatically changed from https to http.&lt;br /&gt;
&lt;br /&gt;
From other posts regarding similar issues I figured out that the WOPI URL is obtained by querying https://[yourinstance]/apps/richdocumentscode/proxy.php?req=/hosting/discovery&lt;br /&gt;
&lt;br /&gt;
Looking at the proxy.php source code, I found the reason for the issue:&lt;br /&gt;
&lt;pre&gt;// URL into this server of the proxy script.&lt;br/&gt;if ((isset($_SERVER[&#039;HTTPS&#039;]) &amp;&amp;amp; $_SERVER[&#039;HTTPS&#039;] !== &#039;off&#039;)&lt;br/&gt;        || (isset($_SERVER[&#039;HTTP_X_FORWARDED_PROTO&#039;]) &amp;&amp;amp; $_SERVER[&#039;HTTP_X_FORWARDED_PROTO&#039;] === &#039;https&#039; )&lt;br/&gt;        || (isset($_SERVER[&#039;HTTP_X_FORWARDED_SSL&#039;]) &amp;&amp;amp; $_SERVER[&#039;HTTP_X_FORWARDED_SSL&#039;] === &#039;on&#039;)&lt;br/&gt;) { &lt;br/&gt;    $proxyURL = &quot;https://&quot;;&lt;br/&gt;} else {&lt;br/&gt;    $proxyURL = &quot;http://&quot;;&lt;br/&gt;}&lt;/pre&gt;&lt;br /&gt;
I then modified my reverse proxy (Apache) config to add the missing header:&lt;br /&gt;
&lt;pre&gt;RequestHeader set X-Forwarded-Proto &quot;https&quot;&lt;/pre&gt;&lt;br /&gt;
Now everything works as expected &lt;img src=&quot;https://blog.crox.net/plugins/serendipity_event_emoticate/img/emoticons/smile.png&quot; alt=&quot;:-)&quot; class=&quot;emoticon&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
 
    </content:encoded>

    <pubDate>Wed, 05 Mar 2025 22:45:00 +0000</pubDate>
    <guid isPermaLink="false">https://blog.crox.net/archives/126-guid.html</guid>
    <category>apache</category>
<category>nextcloud</category>
<category>proxy</category>

</item>
<item>
    <title>Grafana auto login</title>
    <link>https://blog.crox.net/archives/107-Grafana-auto-login.html</link>
    
    <comments>https://blog.crox.net/archives/107-Grafana-auto-login.html#comments</comments>
    <wfw:comment>https://blog.crox.net/wfwcomment.php?cid=107</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>https://blog.crox.net/rss.php?version=2.0&amp;type=comments&amp;cid=107</wfw:commentRss>
    

    <author>nospam@example.com (crox)</author>
    <content:encoded>
    The solution described &lt;a href=&quot;http://docs.grafana.org/tutorials/authproxy/#grafana-authproxy&quot;&gt;here&lt;/a&gt; works for me.&lt;br /&gt;
&lt;br /&gt;
I did the following on the internal host where Grafana is installed:&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Configured Apache (on port 80) as reverse proxy to Grafana (on port 3000)&lt;/li&gt;&lt;li&gt;Setup the virtualhost to add/set the required headers to login automatically as user admin&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
Relevant section from /etc/grafana/grafana.ini:&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;[auth.proxy]&lt;br /&gt;enabled = true&lt;br /&gt;;header_name = X-WEBAUTH-USER&lt;br /&gt;;header_property = username&lt;br /&gt;auto_sign_up = false&lt;/pre&gt;&lt;br /&gt;
Apache config extract (you will need to enable mod_proxy, mod_proxy_http and mod_headers for this to work):&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;&amp;lt;VirtualHost &amp;#42;:80&amp;gt;&lt;br /&gt;        ProxyPreserveHost On&lt;br /&gt;        ProxyRequests Off&lt;br /&gt;        ProxyPass / http://localhost:3000/&lt;br /&gt;        ProxyPassReverse / http://localhost:3000/&lt;br /&gt;        RequestHeader set &quot;X-WEBAUTH-USER&quot; &quot;admin&quot;&lt;br /&gt;&amp;lt;/VirtualHost&amp;gt;&lt;/pre&gt;&lt;br /&gt;
On a separate Apache instance exposed to more networks I did the following:&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Configured Apache as reverse proxy to the internal instance&lt;/li&gt;&lt;li&gt;Restricted access from specific IP addresses&lt;/li&gt;&lt;li&gt;Setup a rule to redirect requests to the root of the website (and only those) to a specific dashboard&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
This is how the Apache config looks like (requires mod_proxy, mod_proxy_http and mod_alias; IP addresses, host names etc. changed)&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;&amp;lt;VirtualHost &amp;#42;:80&amp;gt;&lt;br /&gt;        ServerName sub.example.org&lt;br /&gt;        ServerAlias www.sub.example.org&lt;br /&gt;        &amp;lt;Location /&amp;gt;&lt;br /&gt;            Require ip 192.0.2.0/24&lt;br /&gt;            Require ip 203.0.113.0/24&lt;br /&gt;            Require ip 2001:0db8:85a4::/64&lt;br /&gt;            Require ip 2001:0db8:85a5::/64&lt;br /&gt;            RedirectMatch ^/$ /dashboard/db/mydashboard&lt;br /&gt;        &amp;lt;/Location&amp;gt;&lt;br /&gt;        ProxyPreserveHost On&lt;br /&gt;        ProxyRequests Off&lt;br /&gt;        ProxyPass / http://[2001:0db8:85a3::aaaa:8a2e:0370:7334]/&lt;br /&gt;        ProxyPassReverse / http://[2001:0db8:85a3::aaaa:8a2e:0370:7334]/&lt;br /&gt;&amp;lt;/VirtualHost&amp;gt;&lt;/pre&gt;&lt;br /&gt;
Using a public IPv6 address on the internal host allows the whole thing to work with just a few firewall rules, without the need to mess with NAT or a VPN.&lt;br /&gt;
 
    </content:encoded>

    <pubDate>Tue, 26 Dec 2017 19:57:00 +0000</pubDate>
    <guid isPermaLink="false">https://blog.crox.net/archives/107-guid.html</guid>
    <category>apache</category>
<category>grafana</category>
<category>ipv6</category>
<category>proxy</category>
<category>web</category>

</item>

</channel>
</rss>
