Question
How to proxy https to http and enable ssl?
Hello everyone,
I have configured an app that communicated via websocket (ws) protocol.
I want to config this app over https
but getting “mixed content error”:
** The app was loaded over HTTPS, but attempted to connect to the insecure WebSocket endpoint.
Now I want to proxy https to http while enabling the SSL as well.
My current configs are:
server {
listen 443;
server_name verify.flexibilitaetsmarkt.de;
ssl_certificate /etc/letsencrypt/live/verify.flexibilitaetsmarkt.de/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/verify.flexibilitaetsmarkt.de/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
ssl on;
ssl_session_cache builtin:1000 shared:SSL:10m;
location / {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://127.0.0.1:8000;
proxy_read_timeout 86400;
}
}
server {
listen 8000;
root /home/ubuntu/alf_poc/app;
# Add index.php to the list if you are using PHP
index index.html;
}
However, I’m still getting the same error.
Is there any help how can I proxy/redirect https to http and enable SSL as well?
Many thanks
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
×