孤星斩月 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 C++ 头文件/宏冲突问题解决
  • ¥15 用comsol模拟大气湍流通过底部加热(温度不同)的腔体
  • ¥50 安卓adb backup备份子用户应用数据失败
  • ¥20 有人能用聚类分析帮我分析一下文本内容嘛
  • ¥15 请问Lammps做复合材料拉伸模拟,应力应变曲线问题
  • ¥30 python代码,帮调试
  • ¥15 #MATLAB仿真#车辆换道路径规划
  • ¥15 java 操作 elasticsearch 8.1 实现 索引的重建
  • ¥15 数据可视化Python
  • ¥15 要给毕业设计添加扫码登录的功能!!有偿