Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How do I automatically redirect http to https? #886

Closed
sylvester-roos opened this issue Feb 10, 2021 · 8 comments
Closed

How do I automatically redirect http to https? #886

sylvester-roos opened this issue Feb 10, 2021 · 8 comments

Comments

@sylvester-roos
Copy link

In my example, I have a Bitwarden vault located at example.duckdns.org. If I approach this by https://www.example.duckdns.org then everything is fine. However, I can also approach it by manually typing http://www.example.duckdns.org, which will bring me to the unsecured version of the website, which is not what I want. How do I automatically redirect the http request to https? I looked at the advanced tab and saw a variable called $forward_scheme, but I'm not quite proficient in Nginx yet.

@lieven121
Copy link

Have you tried forcing ssl ?
image

@sylvester-roos
Copy link
Author

I swear I clicked that button when generating the certificate, but double-checking shows it was disabled. Thanks a bunch, it did the trick!

@huangwb8
Copy link

@Pistrie How do you interact NPM with Bitwarden? The tutorial is rare in the internet.

Would you please demonstrate your installion strategy? Thanks!

@sylvester-roos
Copy link
Author

I simply make http ip:port of the vaultwarden server available on a specific subdomain, just like any other service. I'm not sure where your confusion comes from.

@huangwb8
Copy link

huangwb8 commented Apr 10, 2022

@Pistrie Thanks, I had succeed!

In the begining, I built bitwarden and npm as a service in a special network, and I found it difficult to set up nginx setting. Afterwards, I just use my default npm to do proxy things, and it works perfect!

Here is the demo that show how I set bitwarden via NPM:

version: "2"

networks:
  net:
    name: bitwarden

services:
  app:
    image: vaultwarden/server:latest
    environment:
      - SERVER_ADMIN_EMAIL=example@gmail.com
      - SIGNUPS_ALLOWED=false
      - INVITATIONS_ALLOWED=true
      - WEBSOCKET_ENABLED=true
      - ADMIN_TOKEN=<unique token>
    volumes:
      - ./app:/data/
    ports:
      - 6539:80
    restart: unless-stopped
    networks:
      - net

just :

docker-compose up -d

Create a Proxy host, set DESTINATION as http://server.ip:6539. Get a bitwarden.exampledomain.com for https and ssl certificates. If you could not use http challege, please use DNS challege to get Let's Encrypt certificates.

Visit: http://server.ip:6539/admin or https://bitwarden.exampledomain.com , use ADMIN_TOKEN to enter the dashboard.

In General settings, set URL as http://server.ip:6539/admin.

Set SMTP Email Settings.

In the User section, send inviting email to a user.

Done!

@sanderlv
Copy link

sanderlv commented Nov 9, 2022

May I ask, my http domain is not forwarded to https although I have ssl force enabled. both are reachable (https via letsencrypt) is forwarded to the http version but http is not sent to https...

@KajKunstheim
Copy link

I have the same issue. If I request a new certificate the force ssl option gets disabled and I have to enable it after the certificate is created.

@sanderlv
Copy link

sanderlv commented Nov 9, 2022

My issue is different I believe. The fore ssl option is enable dan stays enabled. I just recently created the certs (3 days ago). Since I just started to use nginx manager.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants