Not using SSL-compound for a specific domain



  • There's a host, there's a few domain names on it. The SSL-compound shall be installed for each domain as follows:

    if ( $scheme = "http" ) {
            rewrite ^/(.*)$ https://$host/$1 permanent;
    }
    

    It works. But there's a new one in the house, like Spanish, and it's what I need to use for him to use the usual Internet connection. I have done the following:

    set $domain_conn_type "https";
    if ( $host = "name.domain.es" ) {
            set $domain_conn_type "http";
    }
    if ( $scheme = "http" ) {
            rewrite ^/(.*)$ $domain_conn_type://$host/$1 permanent;
    }
    

    The condition doesn't work. I understand that the variable $host should definitely carry the name of the domen. How am I supposed to catch the name.domain.es in full match? Or maybe this task needs to be handled differently?



  • Perhaps not to "do your own lives" but to say goodbye:

    server {
      listen 80;
      server_name dom.ru dom.su ...;
      rewrite ^ https://$server_name$request_uri? permanent;
    }
    

    server {
    listen 80;
    server_name dom.es;
    ...
    }

    server {
    listen 443 ssl;
    server_name dom.ru;
    ...
    }

    ...




Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2