两个域名指向同一服务器的非80端口
我的个人博客两个域名blog.jaminye.top和blog.jaminye.cn,主机服务器80端口另有他用
所以分配了8080,基本逻辑是80端口反向代理8080端口
配置
server{
listen 80;
server_name blog.jaminye.top blog.jaminye.cn;
location /{
proxy_pass http://127.0.0.1:8080;
}
}
server {
listen 8080;
server_name localhost;
location /{
root /home/www/website/;
index index.html index.htm;
}
}