I have a Nginx reverse proxy (version 1.14.2), but i am having some trouble with $ssl_preread_server_name and $remote_addr is not usable.

This is the code, that logs and checks the variables. The point of this was that the ssl... variable should return a domain name and the remote_addr should return the url. If it's something with the way that requests are send, is it possible to get the local address from the server that is requesting a server.

stream {
    log_format stream_routing '$remote_addr [$time_local] '
      'with SNI name "$ssl_preread_server_name" '
      'proxying to "$name" '
      '$protocol $status $bytes_sent $bytes_received '

    map $ssl_preread_server_name $name {
        panel.mc-maps.dk mcmaps;
        default default;
    upstream default {
    upstream mcmaps {
    server {
        listen 25550;
        ssl_preread on;
        proxy_pass $name;
        access_log /var/log/nginx/stream.log stream_routing;
  • How did you try to connect to the server? – Michael Hampton May 21 at 18:33
  • @MichaelHampton it's set to connect via panel.mc-maps.dk but the server it's requesting is on the same network. As you can see in the log the IP is the default gateway and the SNI (domain) is just - [21/May/2019:19:55:06 +0200] with SNI name "-" proxying to "default" TCP 200 151 87 0.045 – Mikkel S. Vestergård May 21 at 18:47
  • Oops, sorry, I was not clear. I mean, what program did you use? Was it Firefox, or curl, or something else? What command line options? – Michael Hampton May 21 at 18:49
  • @MichaelHampton its fine, to be honest i a not so familiar with the way Multicraft sends requests. But since it's build on PHP i would think that it's curl. – Mikkel S. Vestergård May 21 at 18:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.