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

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

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条回答

      报告相同问题?

      相关推荐 更多相似问题

      悬赏问题

      • ¥15 python 分组计算百分比问题
      • ¥30 关于overflow ,final ALU
      • ¥15 ckeditor工具栏自定义样式
      • ¥15 silvaco 器件仿真的问题
      • ¥20 用c语言设计程序:给定一个从{a,b,c}到其自身的函数f={(a,a),(b,c),(c,b)},判断函数f是否有反函数?
      • ¥15 编写java程序查找回文字符串
      • ¥15 搭建openstack
      • ¥15 几何图形的绘制c++
      • ¥15 英文 软件没办法脱壳,有没有办法进行汉化
      • ¥30 大学数据结构课程,要求运用北京理工大学出版社版数据结构教科书知识设计一款软件并成功运行