Problem with DDNS and URL Cloaking - SOLVED

Issues related to configuring your network
Post Reply
fbafkis
Posts: 11
Joined: 2017/03/22 09:57:32

Problem with DDNS and URL Cloaking - SOLVED

Post by fbafkis » 2017/03/22 21:16:24

Hi everybody!

I have a problem: I configured some services on my server, as resiliosync, transmission, owncloud, plex media server and php virtualbox. I created different VirtualHosts for owncloud, plex and php virtualbox. Then I configured ddns port redirect for each one (on dynu.com) with auto IP update configured on my OpenWrt router. On the router, I configured port forwarding too. port Everything works perfectly, but if I try to activate the option for masking/cloaking url the services don't load (i get an instant load white page without error messages). So the ddns works only in no masking/cloaking mode ( in the address bar I write "mydomain.dynu.net" and then the address become "myip:portassignedtoservice/virtualhost"). The only service that works with cloaking is PlexMedia server. I configured its VirtualHost to auto redirect to its "/web" directory (i found the instructions for configure Proxy and httpd mod rewite on a forum) and this is the configuration:

Code: Select all


<VirtualHost *:32400>
    ServerName mydomain.dynu.net

    <Location />
        AuthType Basic
        AuthName "Restricted area"
        AuthUserFile /private/etc/apache2/htpasswd
        Require valid-user
    </Location>

    <Proxy *>
        Order deny,allow
        Allow from all
    </Proxy>

    ProxyRequests Off
    ProxyPreserveHost On
    ProxyPass / http://127.0.0.1:32400/
    ProxyPassReverse / http://127.0.0.1:32400/

    RewriteEngine on
    RewriteCond %{REQUEST_URI} !^/web
    RewriteCond %{HTTP:X-Plex-Device} ^$
    RewriteRule ^/$ /web/$1 [R,L]
</VirtualHost>




But if I reply these settings in other VirtualHosts .conf files they don't work. And how can I solve the problem on those services that are not configured using VirtualHost (for example Transmission that uses port 9091 or resiliosync that uses port 8888)? Is there a way to change the general settings of httpd to make cloaking work ?


Thank you in advance for support!
Last edited by fbafkis on 2017/06/05 07:34:33, edited 1 time in total.

fbafkis
Posts: 11
Joined: 2017/03/22 09:57:32

Re: Problem with DDNS and URL Cloaking

Post by fbafkis » 2017/04/04 07:01:13

I have the suspect that the problem comes from the proxy settings. Any suggestion about configurations to try?

fbafkis
Posts: 11
Joined: 2017/03/22 09:57:32

Re: Problem with DDNS and URL Cloaking

Post by fbafkis » 2017/04/10 16:47:01

Nobody can help me? ;)

aks
Posts: 3073
Joined: 2014/09/20 11:22:14

Re: Problem with DDNS and URL Cloaking

Post by aks » 2017/04/10 17:18:36

This is how I'm reading it (and yes, I could be wrong):
<VirtualHost *:32400>
If something connects on port 32400
ServerName mydomain.dynu.net
And asks for mydomain.dynu.net
<Location />
AuthType Basic
AuthName "Restricted area"
AuthUserFile /private/etc/apache2/htpasswd
Require valid-user
</Location>
Ask for login for /
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
Proxy requests
ProxyRequests Off
ProxyPreserveHost On
ProxyPass / http://127.0.0.1:32400/
ProxyPassReverse / http://127.0.0.1:32400/
Don't proxy requests but proxy requests to 127.0.0.1:32400 (and preserve the host name).
RewriteEngine on
RewriteCond %{REQUEST_URI} !^/web
If URL contains (at the beginning of the URL /web)
RewriteCond %{HTTP:X-Plex-Device} ^$
Header exists
RewriteRule ^/$ /web/$1 [R,L]
Rewite URL / to /web/$1
</VirtualHost>
Seriously don't understand what you want, but perhaps that'll help.

fbafkis
Posts: 11
Joined: 2017/03/22 09:57:32

Re: Problem with DDNS and URL Cloaking

Post by fbafkis » 2017/04/19 20:14:13

Ok, thank you, but my problem said in a short question is: why url masking/cloaking on the web applications running under CentOS doesn't work?

Thank you for support!

aks
Posts: 3073
Joined: 2014/09/20 11:22:14

Re: Problem with DDNS and URL Cloaking

Post by aks » 2017/04/21 17:03:42

Okay what are you doing? Are you trying to mask the URL or inject (say a frame) to "clone" the DNS request? How are you trying to achieve this?

fbafkis
Posts: 11
Joined: 2017/03/22 09:57:32

Re: Problem with DDNS and URL Cloaking

Post by fbafkis » 2017/04/25 21:45:33

I'm trying to mask the url, but if I try to do it with Dynu (my ddns provider) I obtain a bank page. This happens for every web service/virtual host/app on my server, plex media server excluded. I had found a guide about setting virtual host proxy for plex, to set the automatic redirect to /web/index.html and i followed that. So i think that something in the proxy settings of plex's virtual host makes masking url working. But the question is: what? And then, if I'd find the key to solve the problem, how can I apply that solution to those services that are not using a virtual host ? (e.g. Webmin interface)?

Thank you for your patience!

aks
Posts: 3073
Joined: 2014/09/20 11:22:14

Re: Problem with DDNS and URL Cloaking

Post by aks » 2017/04/27 19:03:41

I still don't really get how you are doing what you claim. If a program sends (something like) GET /api/index.html that's the URL despite what's displayed in the URL bar of a client side browser).

Redirect works like this:

client: GET /api/index.html
server: redirect (either temp. or permanent): try /index.html
client: GET /index.html
server: Here you go ....

What/how are you "hiding" (and be specific here) the URL? In the HTTP GET or what's displayed in the URL bar of a browser?

fbafkis
Posts: 11
Joined: 2017/03/22 09:57:32

Re: Problem with DDNS and URL Cloaking -SOLVED

Post by fbafkis » 2017/06/05 07:34:01

OK, solved!

The problem was in X-Frame Options configuration. I had to change the settings in "ALLOW-FROM: http://myaddress" in the conf file of every service (Webmin, owncloud etc.) that had problems.

Thank you for the advices!

Post Reply