孤星斩月 2019-08-20 09:29 采纳率: 0%
浏览 964

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

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条回答 默认 最新

  • threenewbee 2019-08-20 09:44
    关注

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

    评论

报告相同问题?

悬赏问题

  • ¥15 drone 推送镜像时候 purge: true 推送完毕后没有删除对应的镜像,手动拷贝到服务器执行结果正确在样才能让指令自动执行成功删除对应镜像,如何解决?
  • ¥15 求daily translation(DT)偏差订正方法的代码
  • ¥15 js调用html页面需要隐藏某个按钮
  • ¥15 ads仿真结果在圆图上是怎么读数的
  • ¥20 Cotex M3的调试和程序执行方式是什么样的?
  • ¥20 java项目连接sqlserver时报ssl相关错误
  • ¥15 一道python难题3
  • ¥15 牛顿斯科特系数表表示
  • ¥15 arduino 步进电机
  • ¥20 程序进入HardFault_Handler