Force HTTPS Requests

From Littledamien Wiki
Revision as of 22:14, 12 June 2020 by Video8 (talk | contribs) (Created page with "== Overview == How to force all requests to a web server to be secure, i.e. https. == nginx == Add file `/etc/nginx/conf.d/000_https_redirect_custom.conf`: <pre> server {...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Overview

How to force all requests to a web server to be secure, i.e. https.

nginx

Add file /etc/nginx/conf.d/000_https_redirect_custom.conf:

server {
    listen 80;
    return 301 https://$host$request_uri;
}