[
370
]
Finally, a potential problem is that users may access our site via port
80
, instead of
utilizing HTTPS. We can tell NGINX to forward these people to the secure version
of our site automatically. To do that, we can edit the default configuration file (
/etc/
nginx/sites-available/default
) and add the following line just after the two
listen
directives:
return 301 https://$host$request_uri;
Now, anytime a user visits the HTTP version of our site, they'll be redirected to the
secure HTTPS version automatically.
Now that we've looked at serving web content with both Apache and NGINX, let's
take a moment to discuss
keepalived
, which can help us achieve high availability as
well.
Do'stlaringiz bilan baham: |