• If you need help or want to discuss things, you now can also join us on our Discord Server!
  • A first preview of the unlimited version of SinusBot can be found in the Upcoming Changes thread. A version for Windows will follow, but we don't have a release date, yet.

*Request* redirect non-ssl connections to ssl when ssl is enabled

Status
Not open for further replies.

Surjj

New Member
Hello folks,
I hope I'm not being too vague here but I had a question / request.

Currently when a user mistakenly enters "http://hostname" instead of "https://hostname" in their browser they get a file download named "download" rather than the login page.

I have seen certain webapps that will redirect connections via http to https when ssl is "required" is that something that might be implemented?

Thank you,

Surjj
 

Xuxe

Containerholic
Staff member
is awesome!
V.I.P.
Contributor
Insider
Hello folks,
I hope I'm not being too vague here but I had a question / request.

Currently when a user mistakenly enters "http://hostname" instead of "https://hostname" in their browser they get a file download named "download" rather than the login page.

I have seen certain webapps that will redirect connections via http to https when ssl is "required" is that something that might be implemented?

Thank you,

Surjj

Hey,

the problem is on a "real" webserver (Nginx / Apache) SSL/non SSL is running on different Ports (80/443).
The Bot's webserver is running on your configured Port and with SSL or without.
It makes no sense to start a second Webserver on a other Port just for non SSL redirect :)

A fix is let the bot runn behind a reverse proxy for example Nginx :)
 

Surjj

New Member
Hey,

the problem is on a "real" webserver (Nginx / Apache) SSL/non SSL is running on different Ports (80/443).
The Bot's webserver is running on your configured Port and with SSL or without.
It makes no sense to start a second Webserver on a other Port just for non SSL redirect :)

A fix is let the bot runn behind a reverse proxy for example Nginx :)
Thank you very much! I thought it may require a second instance. I'm hosting in a windows environment, do you know what would be the best / simplest way to go about setting up that reverse proxy?
 

kanalumaddela

Insider
Insider
Thank you very much! I thought it may require a second instance. I'm hosting in a windows environment, do you know what would be the best / simplest way to go about setting up that reverse proxy?
this is for nginx (correct me if i'm wrong, this was a quick type up)
Code:
server {
  listen 80;
  server_name bot.domain.com;
  return 301 https://$host$request_uri;
}

server {
    listen 443 ssl;
    ssl_certificate /location/to/ssl/cert;
    ssl_certificate_key /location/to/ssl/certkey;
   
    server_name bot.domain.com;
   
    location / {
        proxy_pass https://bot.domain.com:8087
    }
}
 
Status
Not open for further replies.
Top