It is currently Fri Jan 15, 2021 11:46 pm
All times are UTC + 8 hours

Redirect URL to port

Web hosting, MySQL, PHP and all that good stuff.

Redirect URL to port

Postby saganne » Sun Aug 03, 2014 9:34 pm

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
saganne
 
Posts: 12
Joined: Sun Feb 16, 2014 8:00 pm

Re: Redirect URL to port

Postby mafredri » Sun Aug 03, 2014 10:16 pm

If your NAS is behind a router you could just try forwarding port 80 to asustor:8000.
Hi, I'm new here. Looking to be active in the community and help with development :).
Storage: AS-604T with 3GB RAM (Kingston KVR1333D3S8S9/2G)
User avatar
mafredri
 
Posts: 371
Joined: Sat Mar 22, 2014 8:41 am

Re: Redirect URL to port

Postby saganne » Sun Aug 03, 2014 10:25 pm

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
saganne
 
Posts: 12
Joined: Sun Feb 16, 2014 8:00 pm

Re: Redirect URL to port

Postby mafredri » Sun Aug 03, 2014 11:38 pm

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
Hi, I'm new here. Looking to be active in the community and help with development :).
Storage: AS-604T with 3GB RAM (Kingston KVR1333D3S8S9/2G)
User avatar
mafredri
 
Posts: 371
Joined: Sat Mar 22, 2014 8:41 am

Re: Redirect URL to port

Postby saganne » Tue Aug 05, 2014 1:17 am

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.
saganne
 
Posts: 12
Joined: Sun Feb 16, 2014 8:00 pm

Re: Redirect URL to port

Postby mafredri » Tue Aug 05, 2014 1:33 am

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.
Hi, I'm new here. Looking to be active in the community and help with development :).
Storage: AS-604T with 3GB RAM (Kingston KVR1333D3S8S9/2G)
User avatar
mafredri
 
Posts: 371
Joined: Sat Mar 22, 2014 8:41 am

Return to Web Hosting

  • You cannot post new topics in this forum
    You cannot reply to topics in this forum
    You cannot edit your posts in this forum
    You cannot delete your posts in this forum
    You cannot post attachments in this forum
  • Who is online

    Users browsing this forum: No registered users and 1 guest

cron