内容:
在一个linux 服务器中安装了docker容器,并在docker中安装nginx 镜像,用nginx 容器来实现同主机多站点配置:
错误:
在配置域名:server_name 的时候只写了主域名(aaaaa.com) 而没有写具体的域名(www.aaaaa.com),导致我部署的两个站点都同时指向了同一个站点,两个站点只能访问到一个站点。在网上找了很多资料,都只是在将怎么实现站点部署,没有点出这个小问题。程序界中,往往是小问题难道一片人。
#a.conf
server {
listen 80;
listen [::]:80;
server_name aaaaa.com;
#charset koi8-r;
#access_log /var/log/nginx/host.access.log main;
location / {
root /usr/share/nginx/html/RIM;
index index.html index.htm;
}
#静态资源
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|js|css|ico|woff)$
{
root /usr/share/nginx/html/RIM;
access_log on;
}</