亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

How to ban IP access to HTTPS site (nginx)?
阿神
阿神 2017-05-16 17:27:35
0
3
988

How to prohibit IP from directly accessing HTTPS

The following settings are set in nginx:

server {
    listen 80;
    listen 443 ssl spdy;
    root /data0/web/domain.com;
    server_name domain.com *.domain.com;
    index index.html index.htm index.php;

    location / {
    }
}

##default
server {
    listen 80 default;
    listen 443 default;

    server_name _;

    root /data0/web/empty;

    location / {
        return 500;
    }
}

Set as above, access https://ip. SSL doesn't work. Even if you visit https://domain.com, you cannot access it.

阿神
阿神

閉關(guān)修行中......

reply all(3)
左手右手慢動(dòng)作

It’s OK to use code like this

server 
        {
                listen 443 default;
                return 400;
        }
曾經(jīng)蠟筆沒有小新
server
{
    listen 443 ssl default_server;
    ssl_certificate      path_to_your_fullchain.cer;
    ssl_certificate_key  paht_to_your_key;
    return 301 https://demo.com;
}

Be sure to configure the ssl certificate, otherwise it will not work

黃舟
listen 80 default;
server_name domain.com *.domain.com;
...

if ( $host ~* "\d+\.\d+\.\d+\.\d+" ) {
    return 400;
}
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template