Link to home
Start Free TrialLog in
Avatar of oxygen_728
oxygen_728

asked on

Ubuntu Server, Apache2, SSL -- How do I turn off http access to my webserver? I want HTTPS only

Hi.

I just got SSL working on my ubuntu server - apache2  web server .

I either want to disable normal http access to my site or automatically or automatically redirect all http traffic to the https version.

Any tips?

Thanks

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of omarfarid
omarfarid
Flag of United Arab Emirates image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
iptables -t NAT POSTROUTING -d ip.of.server -p tcp --dport 80 --REDIRECT --to 443

I wrote the rule out of my head it might need some fine tuning though...it redirects all traffic coming to port 80 to port 443 ..i.e. https.