Current-Users archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: Redirecting 80 to 443
Am Dienstag, 6. Juni 2023, 19:54:46 CEST schrieben Sie:
> I wanted to know now, since I have added a cert, how do I redirect all port
> 80 requests to port 443?
NetBSDs "default" Webserver "bozotic" is - compared to todays typical
internet webservers - very (!) limited and as such suitable to "just serve
some files by HTTP" by a "simple" config.
https://atomicules.co.uk/2017/07/30/Redirecting-from-http-to-https-with-Bozohttpd.html
Many / most internet web sites / servers require a more "capable" webserver.
I would prefer Apache 2.4 or Nginx.
i.e.
redirect with Apache2.4
<VirtualHost *:80>
ServerName mysite.example.com
Redirect permanent / https://mysite.example.com/
</VirtualHost>
redirect with Nginx:
server {
listen 80;
server_name example.com;
return 301 https://$server_name/something;
}
server {
listen 443;
server_name example.com;
return 301 https://$server_name/something;
}
hth
best regards,
niels.
--
---
Niels Dettenbach
Syndicat IT & Internet
https://www.syndicat.com
PGP: https://syndicat.com/pub_key.asc
---
Home |
Main Index |
Thread Index |
Old Index