Page 1 of 1

Redirect URL to port

Posted: Sun Aug 03, 2014 9:34 pm
by saganne
Hi experts,

I'm triing to make an access to my ADM without the port in the URL (http://mynas.myasustor.com instead of http://mynas.myasustor.com:XXX)

To do that I've try to modify the file httpd.conf (in /volume0/usr/builtin/etc/apache2).
I added this :

Code: Select all

NameVirtualHost *:80

<VirtualHost *:80>
    ServerName mynas.myasustor.com

    ProxyPass / http://localhost:XXX/
    ProxyPassReverse / http://localhost:XXX/
</VirtualHost>
where XXX is the ADM port.
But it doesn't work and worse it crashes all webservices (photo-gallery, plex, owncloud ...)

Does somebody have the tips ?

edit : I didn't precise but if I redirect 80 to XXX (from the router), I can log to ADM without specifying the port but webservices are then unaccessible

Re: Redirect URL to port

Posted: Sun Aug 03, 2014 10:16 pm
by mafredri
If your NAS is behind a router you could just try forwarding port 80 to asustor:8000.

Re: Redirect URL to port

Posted: Sun Aug 03, 2014 10:25 pm
by saganne
mafredri wrote:If your NAS is behind a router you could just try forwarding port 80 to asustor:8000.
After doing that you can't access anymore to webservices

Re: Redirect URL to port

Posted: Sun Aug 03, 2014 11:38 pm
by mafredri
saganne wrote:After doing that you can't access anymore to webservices
Ah yes, I see your predicament. I tried making a custom vhost myself but it seems ADM doesn't like that. You could try to create a new vhost in ADM (e.g. mynas.myasustor.com) and try to set up a .htaccess in the directory that you specify there: http://stackoverflow.com/questions/1952 ... with-proxy

Re: Redirect URL to port

Posted: Tue Aug 05, 2014 1:17 am
by saganne
Good idea but same result, it locks other webservices (or I done something wrong). It works only if I done a vhost like mynas.myasustor.com/vhost so not interesting.

Re: Redirect URL to port

Posted: Tue Aug 05, 2014 1:33 am
by mafredri
Well, what you want to do will automatically block out all other services. You will have to either whitelist the folders you don't want to proxy redirect OR you could only pass through e.g. /portal. You could set up the root folder to redirect you to /portal which will then use proxy. Then you should still have the others available.