400: The Plain HTTP Request Was Sent to HTTPS Port

As you build your web application, you might encounter a scenario where you need to redirect users from one port to another. This is especially common when using the Nginx server, which is widely used for hosting static websites and applications.

Nginx, like other web servers, uses HTTP (Hypertext Transfer Protocol) by default. However, in some cases, you might need to redirect users from an HTTPS port (port 443) to an HTTP port (port 80). This is because the URL scheme is different between HTTPS and HTTP.

To achieve this redirection, you can use Nginx's built-in server_alias directive. Here is an example of how to set it up:

        server {
            listen 443 ssl;
            server_name example.com;

            location / {
                proxy_pass http://example.com:80;
                proxy_set_header Host $host;
                proxy_set_header X-Real-IP $remote_addr;
            }
        }
    

Here's a breakdown of the code:

http://apocalypse.moy.su/go?http://spicy1.blob.core.windows.net/plumber-adelaide/plumber-adelaide/plumber-adelaide.html