[GH-ISSUE #886] How do I automatically redirect http to https? #748

Closed
opened 2026-02-26 06:34:15 +03:00 by kerem · 8 comments
Owner

Originally created by @sylvesterroos on GitHub (Feb 10, 2021).
Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/886

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.

Originally created by @sylvesterroos on GitHub (Feb 10, 2021). Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/886 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.
kerem 2026-02-26 06:34:15 +03:00
Author
Owner

@lieven121 commented on GitHub (Feb 11, 2021):

Have you tried forcing ssl ?
image

<!-- gh-comment-id:777265057 --> @lieven121 commented on GitHub (Feb 11, 2021): Have you tried forcing ssl ? ![image](https://user-images.githubusercontent.com/7773244/107613415-90570800-6c48-11eb-8312-a2b2370342bd.png)
Author
Owner

@sylvesterroos commented on GitHub (Feb 11, 2021):

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

<!-- gh-comment-id:777317179 --> @sylvesterroos commented on GitHub (Feb 11, 2021): I swear I clicked that button when generating the certificate, but double-checking shows it was disabled. Thanks a bunch, it did the trick!
Author
Owner

@huangwb8 commented on GitHub (Apr 10, 2022):

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

Would you please demonstrate your installion strategy? Thanks!

<!-- gh-comment-id:1094208908 --> @huangwb8 commented on GitHub (Apr 10, 2022): @Pistrie How do you interact NPM with Bitwarden? The tutorial is rare in the internet. Would you please demonstrate your installion strategy? Thanks!
Author
Owner

@sylvesterroos commented on GitHub (Apr 10, 2022):

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.

<!-- gh-comment-id:1094248292 --> @sylvesterroos commented on GitHub (Apr 10, 2022): 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.
Author
Owner

@huangwb8 commented on GitHub (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!

<!-- gh-comment-id:1094250024 --> @huangwb8 commented on GitHub (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: ```yaml 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 : ```bash 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!
Author
Owner

@sanderlv commented on GitHub (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...

<!-- gh-comment-id:1309237970 --> @sanderlv commented on GitHub (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...
Author
Owner

@KajKunstheim commented on GitHub (Nov 9, 2022):

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.

<!-- gh-comment-id:1309347101 --> @KajKunstheim commented on GitHub (Nov 9, 2022): 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.
Author
Owner

@sanderlv commented on GitHub (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.

<!-- gh-comment-id:1309349764 --> @sanderlv commented on GitHub (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 in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/nginx-proxy-manager-NginxProxyManager#748
No description provided.