0

I have a program that serves pages via http (without SSL) on windows. I want to make that secure if it's possible.

I tried to write my own middle-ware but I failed. It worked but it can't handle web-sockets. Here is my code if anyone wants something simpler: link

If anyone can recommend a program that runs on Windows and can act as a proxy server, serves pages via SSL and supports POST requests and Web-Sockets.

Thanks. I’m looking forward to your reply.

1 Answer 1

1

I found a solution to my proplem: I use nginx as a proxy server.

Here is my conf file:

worker_processes  2;

events {
    worker_connections  1024;
}

http {
    sendfile on;

    #https proxy server
    server {
        listen               443 ssl;
        server_name          localhost;
        ssl_certificate      ../ssl/cert.crt;
        ssl_certificate_key  ../ssl/private.key;

        location / {
            proxy_pass       http://127.0.0.1:80/;
            proxy_set_header X-Forwarded-For $remote_addr;
        }

        location /ws/ {
            proxy_pass         http://127.0.0.1:80/$request_uri;
            proxy_http_version 1.1;
            proxy_set_header   X-Forwarded-For $remote_addr;
            proxy_set_header   Upgrade $http_upgrade;
            proxy_set_header   Connection "Upgrade";
        }

    }
}
1
  • Check out nginx Proxy Manager, it's nginx packaged with a nice UI to help manage it. (no more manual restarts of nginx :))
    – Lockszmith
    Commented Sep 6, 2021 at 20:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.