0

何らかの理由で、に移動するとhttp://mydomain.me/s1、件名: < a subdomain that has it's own server config.Your connection isn't privateNET::ERR_CERT_COMMON_NAME_INVALIDhomeassistant.mydomain.me

しかし、私が に行ってウェブサイトを見たときのように、 にウェブサイトが表示されることを期待しています127.0.0.1:8081chivers.me/127.0.0.1:8080

なぜこうなった?

mydomain.me:

server {
    listen 80 ;
    server_name mydomain.me;

    location / {
        proxy_pass http://127.0.0.1:8080/;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }

    location /s1/ {
        proxy_pass http://127.0.0.1:8081/;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }
}

homeassistant.mydomain.me:

map $http_upgrade $connection_upgrade {
    default upgrade;
    ''      close;
}

server {
    server_name homeassistant.mydomain.me;
    listen 80;
    return 301 https://$host$request_uri;
}

server {
    listen 443 ssl;
    server_name homeassistant.mydomain.me;

    ssl_certificate /etc/letsencrypt/live/homeassistant.mydomain.me/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/homeassistant.mydomain.me/privkey.pem;
    ssl_dhparam /etc/nginx/ssl/dhparams.pem;

    add_header Strict-Transport-Security "max-age=31536000; includeSubdomains";
    
    ssl_protocols TLSv1.2;
    ssl_ciphers "EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH:!aNULL:!eNULL:!EXPORT:!DES:!MD5:!PSK:!RC4";
    ssl_prefer_server_ciphers on;
    ssl_session_cache shared:SSL:10m;

    proxy_buffering off;

    location / {
        proxy_pass http://my-home-assistant.url:8123;
        proxy_set_header Host $host;
        proxy_redirect http:// https://;
        proxy_http_version 1.1;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection $connection_upgrade;
    }
}

subdom1.mydomain.me:

server {
    listen 80;
    server_name subdom1.mydomain.me;

    location / {
        proxy_pass http://another-url.co.uk/;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }
}
4

0 に答える 0