简体   繁体   中英

Nginx subdomain (and domain) not working

I'm on windows 7 x32 and this my nginx file:

worker_processes  1;

events {
    worker_connections  1024;
}


http {
    server_names_hash_bucket_size 64;
    include       mime.types;
    default_type  application/octet-stream;

    sendfile        on;

    keepalive_timeout  65;

    gzip  on;
    upstream app_opencubes {
        server 127.0.0.1:1234;
    }   

    server {
        listen       80;
        server_name  www.opencubes.io opencubes.io;

        #charset koi8-r;
        access_log  logs/host.access.log;
        location / {
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header Host $http_host;
            proxy_set_header X-NginX-Proxy true;

            proxy_pass http://app_opencubes/;
            proxy_redirect off;
        }

        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }


    }
    server {
        listen       80;
        server_name  my.opencubes.io;

        #charset koi8-r;
        access_log  logs/host.access.log;
        location / {
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header Host $http_host;
            proxy_set_header X-NginX-Proxy true;

            proxy_pass http://app_opencubes/dashboard/;
            proxy_redirect off;
        }

        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }


    }


}

Whenever I try to reach opencubes.io or my.opencubes.io , my browser says can't load url. But when I try localhost it works

OK I need to add this to C:/window/system32/drivers/hosts :

127.0.0.1       opencubes.io
127.0.0.1       my.opencubes.io

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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