受欢迎的博客标签

How to configure multiple IP address on the same Nginx?

Published

How to configure multiple IP address  on the same  Nginx?

server {
    listen 1.2.3.4:80;
    server_name www.example.com example.com;
    return 301 https://$server_name$request_uri;
}

server {
    listen 2.3.4.5:443;
    server_name example.com;
    return 301 https://www.$server_name$request_uri;
}