Force SSL

SpeicherNerd

Dabbler
Joined
Oct 25, 2020
Messages
18
Hi there,
how can i force ssl? what exactly has to be processed in the nginx.conf, have made some unsuccessful attempts
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,700
Do you mean either one of these options?:
Code:
  server {
    listen  *:80;

    server_name domain.com;

    return 301 https://$host$request_uri;
    #rewrite ^ https://<domain>$request_uri? permanent;
  }


Either the return 301or the rewrite line can work... depends on what you want to handle (what the website is doing behind it when the client then connects on https... maybe it keeps throwing it back to http).

Highly dependent on the app you're using and how it's set up... e.g. nextcloud has config that rewrites the URL with every page served, so can mess up what you do with the reverse proxy setup.
 
Top