域名跳转到带端口的域名怎么办?

1、我用的是VPS,windows系统,iis中已经有一个.net网站,用的80端口,现在这个网站是用nodejs做的,nginx配置的,iis的80端口不能改,一改.net网站就会出问题。

2、现在是这个nodejs网站,域名后面必须加一个端口号,隐藏不掉。nginx代理都配置过了。

3、之前的问题是网站属于域名必须加上端口才能打开, 现在调了好久,情况是,输入域名不带端口可以打开,但是跳转到带端口的域名。域名是www.juquba.com。请大佬们指教一下。iis中我对juquba这个域名进行了80端口绑定。

#user nobody;
worker_processes 1;

#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;

#pid logs/nginx.pid;

events {
worker_connections 1024;
}

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

#log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
#                  '$status $body_bytes_sent "$http_referer" '
#                  '"$http_user_agent" "$http_x_forwarded_for"';

#access_log  logs/access.log  main;

sendfile        on;
#tcp_nopush     on;

#keepalive_timeout  0;
keepalive_timeout  65;

#gzip  on;

server {
    listen       80
    server_name  www.juquba.com juquba.com;

    #charset koi8-r;

    #access_log  logs/host.access.log  main;

    location / {
        root         D:/juquba;
        index  index.html index.htm;
        proxy_pass   http://www.juquba.com:3000;
    }

    location ~ .*.(jpg|jpeg|png|gif|ico)$ {
        proxy_pass   http://www.juquba.com:3000;
        proxy_ignore_headers X-Accel-Expires Expires Cache-Control Set-Cookie;
        expires 15d;
    }

    location ~ .*.(js|css)$ {
        proxy_pass   http://www.juquba.com:3000;
        proxy_ignore_headers X-Accel-Expires Expires Cache-Control Set-Cookie;
        expires 7d;
    }

    #error_page  404              /404.html;

    # redirect server error pages to the static page /50x.html
    #
    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
        root   html;
    }

    # proxy the PHP scripts to Apache listening on 127.0.0.1:80
    #
    #location ~ \.php$ {
    #    proxy_pass   http://127.0.0.1;
    #}

    # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
    #
    #location ~ \.php$ {
    #    root           html;
    #    fastcgi_pass   127.0.0.1:9000;
    #    fastcgi_index  index.php;
    #    fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;
    #    include        fastcgi_params;
    #}

    # deny access to .htaccess files, if Apache's document root
    # concurs with nginx's one
    #
    #location ~ /\.ht {
    #    deny  all;
    #}
}


# another virtual host using mix of IP-, name-, and port-based configuration
#
#server {
#    listen       8000;
#    listen       somename:8080;
#    server_name  somename  alias  another.alias;

#    location / {
#        root   html;
#        index  index.html index.htm;
#    }
#}


# HTTPS server
#
#server {
#    listen       443 ssl;
#    server_name  localhost;

#    ssl_certificate      cert.pem;
#    ssl_certificate_key  cert.key;

#    ssl_session_cache    shared:SSL:1m;
#    ssl_session_timeout  5m;

#    ssl_ciphers  HIGH:!aNULL:!MD5;
#    ssl_prefer_server_ciphers  on;

#    location / {
#        root   html;
#        index  index.html index.htm;
#    }
#}

}

1个回答

不能让iis占住80端口,相反,应该让iis换别的端口,ngnix反向代理。你说的iis改端口就出错是不存在的。

hnzzzph2012
孤星斩月 哦。谢谢。
12 个月之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问