Difference between revisions of "NextCloud/Pain points/https"
< NextCloud | Pain points
Jump to navigation
Jump to search
(12 intermediate revisions by the same user not shown) | |||
Line 7: | Line 7: | ||
This is done nice and easily, by amending the <code>.htaccess</code> file in the root of the NextCloud installation. | This is done nice and easily, by amending the <code>.htaccess</code> file in the root of the NextCloud installation. | ||
+ | |||
+ | |||
Add the following: | Add the following: | ||
+ | <div style="padding-left: 20px"> | ||
+ | <pre>RewriteEngine On | ||
+ | RewriteCond %{HTTPS} off | ||
+ | RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]</pre> | ||
+ | </div> | ||
+ | |||
− | + | This will catch requests made from http, and redirect them to https. |
Latest revision as of 19:24, 15 March 2021
Forcing https
It is of course strongly suggested that you always run this sort of platform behind https (so snoopers can't directly see the traffic)...
Assuming that you have an SSL cert on the domain, you'll want to redirect all http traffic to https.
This is done nice and easily, by amending the .htaccess
file in the root of the NextCloud installation.
Add the following:
RewriteEngine On RewriteCond %{HTTPS} off RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
This will catch requests made from http, and redirect them to https.