M
M
Marcel Markhabulin2013-11-21 16:51:22
Nginx
Marcel Markhabulin, 2013-11-21 16:51:22

How does SSL work on a non-standard port?

There is nginx which has

server { listen 80; server_name www.example.com; ... }
server { listen 443 ssl; server_name www.example.com; ... }

Everything is set up, everything works. Haproxy is installed on the same server on port 8100.
Task: to make the browser connection to the address https://www.example.com:8100/test.txt - also secure. Everything works on http.
What is the logic of how SSL works in this request? Should haproxy give away secure connection from port 8100 or haproxy backend? Isn't SSL trying to force a connection with 443? And, if so, what is the correct algorithm for building the correct architecture for the service to work with SSL on a different port outside of nginx?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Marcel Markhabulin, 2013-11-21
@milar

I found a working solution - add to nginx:

server {
   listen 8100 ssl;
   server_name www.example.com;
   proxy_pass http://www.example.com:{haproxy_local_port};
   ...
}
However, architecturally it does not look very cool.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question