Redirect Port 2080 to 2443?

Hi there,

I wonder if currently there’s a way that I can force/redirect user who visits siteworx using port 2080 to port 2443? I want to ensure users are going through the secure port 2443 when logging in. Any inputs would be much appreciated. Thank you! :slight_smile:

Hi Shyuan

I hope your well

Sorry for lateness, I have just returned from a family holiday, and I believe the following should work for you, but I have nnot tested sorry.

I hope you don’t mind, but I’m thinking a simpler solution would be to turn off port 2080

Edit /etc/httpd/conf.d/iworx.conf

RewriteCond %{2080} !^2443$
RewriteRule ^/siteworx(/)?$ https://serverhostname:2443/siteworx/?domain=%{HTTP_HOST} [R,L]
RewriteCond %{2080} !^2443$
RewriteRule ^/nodeworx(/)?$ https://serverhostname:2443/nodeworx/ [R,L]12

I hope that helps a little and sorry if I am wrong

Many thanks

John

Hi shyuan

I’m sorry, rereading my post I think I have it wrong slightly as follows

Please delete the {} brackets, so it reads %2080

You could use %{server_port} but that might redirect all port traffic

Hope that helps and sorry if I’m wrong

Many thanks

John

Hi John,

I knew you were on holiday, so you’re forgiven :stuck_out_tongue: Just joking! :stuck_out_tongue:

I will try it out and let you know later, thank you very much for helping out!

Hi John,

I did exactly what you taught, but when i visit http://domain.com:2080 or http://domain.com:2080/siteworx, it doesn’t seem to redirect. Any idea why? :slight_smile:

Hi shyuan

I’m sorry, I’ll have to test it but one thought is you may need to put in vhost file as well perhaps, but this depends if you have set it on its own siteworx account.

I’ll try to test it over bank holiday and let you know

Many thanks

John

I have done the following in iworx.conf:


RewriteEngine on
RewriteRule ^/siteworx(/)?$ https://everest.snowpeakhosting.com:2443/siteworx/\?domain=%{HTTP_HOST} [R,L]
RewriteRule ^/nodeworx(/)?$ https://everest.snowpeakhosting.com:2443/nodeworx/ [R,L]

And then we ask customers to use <customerdomain.com>/siteworx to access the Controlpanel.

Hi Evanion

I hope your well

I believe shyuan already has that setup and working, but shyuan also requires to have port 2080 forward to same.

I thought my port forward may have worked, but guessing I’m missing something, sorry.

Many thanks

John

Hi Shyuan

I hope you don’t mind, but please can you try as follows:

SSH into server

cd /usr/local/interworx/etc/httpd
vi httpd-custom.conf

add the following at the very end httpd-custom.conf

RewriteEngine on
RewriteCond %{SERVER_PORT} =2080
RewriteRule ^(.*) https://%{SERVER_NAME}%{REQUEST_URI} [R,L]

save and run service iworx restart

test

A word of warning though, webmail may have issues as it uses port 2080, but I could be wrong sorry, and use at your risk, and I’m sure they may be a better solution, so sorry if there is.

Many thanks

John

Hi Shuyan

Sorry, Please remember to clear any browser cache and test.

Many thanks

John

Hi John,

Thanks for the detailed guide :slight_smile:

As far as I can see webmail can use port 2443 as well, so that shouldn’t be a problem. :slight_smile:

I will adopt Evanion’s method as of now, which I believe is the easiest way to just ask clients to access <domain.com>/siteworx and have it redirected to <myserverhostname.com>:2443/siteworx. Clients probably won’t know about port 2080 if I don’t make them aware of it, so I think I will keep the 2080 redirection guide for later use.

Thank you very much Evanion! :slight_smile:

Quick question for the more knowledgable: Why redirect 2080 instead of simply closing it?

Cheers,

Michael

Hi Michael

I think it’s more of a personal choice as I mentioned about simply closing port.

Which ever option your happy with

Many thanks

John