简体   繁体   English

jwilder / nginx-proxy指向Nginx欢迎屏幕

[英]jwilder/nginx-proxy points to the nginx welcome screen

I am trying to use the nginx-proxy docker container, but if I point to my domain with no subdomain (mydomain.com) then I just get the welcome page. 我正在尝试使用nginx-proxy docker容器,但是如果我指向没有子域的域(mydomain.com),那么我只会得到欢迎页面。 I am using Docker-Compose and my .yml file looks like this: 我正在使用Docker-Compose,而我的.yml文件如下所示:

proxy:
  image: jwilder/nginx-proxy
  volumes:
    - /var/run/docker.sock:/tmp/docker.sock:ro
  environment:
    DEFAULT_HOST: mydomain.com
  ports:
    - "80:80"

frontend:
  image: julienvincent/nginx:react
  ports:
    - "8000:80"
  expose:
     - "80"
  volumes:
     - frontend/src/build:/data/www
  environment:
    VIRTUAL_HOST: www.mydomain.com, mydomain.com

Is this an error in my configuration? 这是我配置中的错误吗?

Your mistake is with the VIRTUAL_HOST environment variable. 您的错误与VIRTUAL_HOST环境变量有关。 When you want to set its value with multiple domains , you MUST not use any space character. 当您想在多个域中设置其值时,不得使用任何空格字符。

Change it to VIRTUAL_HOST: www.mydomain.com,mydomain.com and everything will work out as expected. 将其更改为VIRTUAL_HOST: www.mydomain.com,mydomain.com ,一切都会按预期进行。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM