-
Notifications
You must be signed in to change notification settings - Fork 228
HTTPS (SSL) support #424
Description
I managed to install weserv on my windows 11 laptop, after I realized there is internal ip forwarding within the laptop (dos command) to the wsl listening port, which is different than the machin port.
I still cant use my laptops weserv since my website is https and modern browsers do not display http: images in Https: pages.
My hosting company now offers subdomains with dynanmic dns updating urls and offers ssl certificate, authority bundle, and private key.
I can't find documentation for easily pasting these somewhere to get weserv to use https.
My paid chatpt offered me 10 pages on instructions without any satifying explanation. So, I am sure it will not work, per 24 years of experience following complex linux instructions. Anything over 4 paragraphs, never works, due to localizations, caveats, typos, assumptions by the instructor, etc. The ai wants reverse proxies and other voodoo wizzard commands, I don't feel comfortable.
I compained that the instructions were too complex and involved seemingly silly reverse proxied, and it gave me the following less convoluted instructions. I am not sure I trust the instructions to work or not mess up my working weserv: Ai ,"I understand the frustration with the complexity of setting up SSL with additional tools like Nginx. However, Nginx is commonly used because it efficiently handles SSL termination and reverse proxying. If you prefer not to use Nginx and are looking for a simpler solution, you might need to configure the weserv service itself to use SSL, if it supports such configuration directly.
Here's a simpler approach without introducing Nginx, assuming weserv can be configured to handle SSL directly.
Step-by-Step Guide to Using SSL Directly with weserv in Docker
-
Prepare Your SSL Certificate:
Ensure you have the SSL certificate (thunder.clevelandohioxxx.com.crt), private key (thunder.clevelandxxx.key), and the intermediate certificate (if applicable,intermediate.crt). -
Modify Dockerfile for weserv (if needed):
You might need to modify the Dockerfile for the weserv image to include SSL support if it's not already present. However, this might require some custom configuration depending on the base image used by weserv. -
Docker Compose Configuration:
If weserv itself can handle SSL, you'll configure it directly within yourdocker-compose.ymlfile. Here's a hypothetical example (note that this assumes weserv's Docker image or underlying service supports SSL configuration directly):
version: '3'
services:
weserv:
image: weserv/images:latest
ports:
- "80:80"
- "443:443"
environment:
- SSL_CERT_PATH=/etc/ssl/certs/thunder.clevelandXXX.com.crt
- SSL_KEY_PATH=/etc/ssl/private/thunder.clevelandxxx.com.key
- SSL_INTERMEDIATE_PATH=/etc/ssl/certs/intermediate.crt # If applicable
volumes:
- ./ssl/certs:/etc/ssl/certs
- ./ssl/private:/etc/ssl/privateExplanation:
- SSL_CERT_PATH, SSL_KEY_PATH, SSL_INTERMEDIATE_PATH: Environment variables (hypothetical) for SSL paths.
- volumes: Mount local SSL certificate and key files into the Docker container.
- Directory Structure and SSL Files:
Ensure your directory structure looks like this:
~/weserv-docker/
|-- docker-compose.yml
|-- ssl/
|-- certs/
|-- thunder.clevelandohioxxx.com.crt
|-- intermediate.crt # If applicable
|-- private/
|-- thunder.clevelandxxx.com.key- Start Docker Container:
Navigate to your project directory and start the container:
cd ~/weserv-docker
docker-compose up -d- Verify Configuration:
Open your browser and navigate tohttps://thunder.clevelandxxx.com.
Important Notes:
- This approach assumes the weserv Docker image or the underlying service supports direct SSL configuration. If not, you may need to delve into modifying the Docker image or using a different service that does support SSL natively.
- If weserv doesn’t support SSL configuration directly, using a reverse proxy like Nginx (as initially described) is a standard approach to handle SSL termination.
If you find that weserv does not support SSL configuration directly and you must use a reverse proxy, please let me know, and I can assist in simplifying the process or explore alternative solutions.
my site is a weather site and I xxx over part of the name. I realize it now looks like a xxx site that I am squeezing the images to the lowest resolution possible, lol. No, I use weserv and my site to get 200 megs of weather products down to 1 meg, so I don't blow out my phone data by just reloading my weather 4 or 5 times a day on iffy weather days.