[技术方案]
【服务端】产品访问默认端口9001如何修改为其他端口。
 产品交流
 
3563 人阅读
|
1 人回复
|
2020-10-26
产品交流
 
3563 人阅读
|
1 人回复
|
2020-10-26 
 
 
 
 
|  | 
 
 
| 产品访问工程的端口大家都知道,产品默认安装后是访问9001进入产品前端。 有一些伙伴可能应公司要求或者其他因素要求需要将产品的默认访问端口:9001调整为其他端口,这里就需要去修改产品的配置文件了。
 
 相关配置大家可以参考如下:
 
 
 1.进入产品安装目录中根目录的Ngxin文件夹配置文件目录中。
 
 2.打开Ngxin的配置文件:nginx.conf
 
 nginx.conf (在目录中的一个conf文件,右击打开方式为记事本,有NotePad++可以用其打开编辑)3.搜索默认端口:9001,并进行修改。
 
 Ctrl+F 键进行搜索:9001 定位后将 9001调整为其想修改的端口号即可此处有一个问题就是大家所需要修改的端口号一定是没有被占用的端口,如果被占用了启动时会出现报错。
 
 4.保存即可。
 
 
 举一个将默认端口9001修改为80端口的教程:
 
 1.源文件代码:[mw_shl_code=xml,true]#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;
 
 sendfile        on;
 
 keepalive_timeout  65;
 gzip on;            #开启gzip功能
 gzip_min_length  1024;      #响应页面数据上限
 gzip_buffers     4 16k;         #缓存空间大小
 gzip_http_version 1.1;      #http协议版本
 gzip_comp_level  4;         #压缩级别4
 gzip_types       text/plain application/x-javascript text/css application/xml text/javascript;
 gzip_vary on;       #启用压缩标识
 gzip_static on;     #开启文件预压缩
 
 server {
 listen 9001;
 server_name localhost;
 client_max_body_size 1000m;
 root ../web;
 index  index.html index.htm;
 
 # 图片访问配置
 location ~/designer/static/ {
 root html;
 autoindex on;
 }
 location ~/sso/static/ {
 root html;
 autoindex on;
 }
 
 
 location /dw {
 proxy_set_header   X-Real-IP $remote_addr;
 proxy_set_header   Host      $http_host;
 proxy_pass         http://localhost:9997/dw;
 proxy_read_timeout 259200s;
 proxy_set_header Upgrade $http_upgrade;
 proxy_set_header Connection "upgrade";
 }
 
 location /designer {
 proxy_set_header   X-Real-IP $remote_addr;
 proxy_set_header   Host      $http_host;
 proxy_pass         http://localhost:9996/designer;
 proxy_read_timeout 7200s;
 proxy_set_header Upgrade $http_upgrade;
 proxy_set_header Connection "upgrade";
 }
 
 location /factdata {
 proxy_set_header   X-Real-IP $remote_addr;
 proxy_set_header   Host      $http_host;
 proxy_pass         http://localhost:9995/factdata;
 proxy_read_timeout 7200s;
 proxy_set_header Upgrade $http_upgrade;
 proxy_set_header Connection "upgrade";
 }
 
 location /sso {
 proxy_set_header   X-Real-IP $remote_addr;
 proxy_set_header   Host      $http_host;
 proxy_pass         http://localhost:9994/sso;
 proxy_read_timeout 7200s;
 proxy_set_header Upgrade $http_upgrade;
 proxy_set_header Connection "upgrade";
 }
 location /jarupdater {
 proxy_set_header   X-Real-IP $remote_addr;
 proxy_set_header   Host      $http_host;
 proxy_pass         http://192.168.8.1:9988/;
 }
 
 location /data {
 try_files $uri $uri/ /data/index.html;
 }
 location /newdw {
 try_files $uri $uri/ /newdw/index.html;
 }
 location /mobile {
 try_files $uri $uri/ /mobile/index.html;
 }
 
 location / {
 try_files $uri $uri/ /index.html;
 }
 
 
 }
 }[/mw_shl_code]
 
 2.修改第33行内容
 
         由 listen 9001; 改为: listen 80; 修改完毕即可。
 
 以上就是调整产品的访问默认端口教程,自测的一种方式,如果大家有好的意见可以在下面提出来哦!
 
 
 | 
 | 
| “锲而舍之,朽木不折;锲而不舍,金石可镂”。滴水可以穿石,不是因为其力量,而是因为其坚韧不拔、锲而不舍。用一丝不苟的心对待每一件事,只有把根基做深,墙才会筑的更高。用我们的专业和诚信赢得您的信赖,让每一次合作总能超越期待。
 | 
|
|  | 
|  |  | 
 
 
|  | 
 
  
admin 
 
发表于 2020-12-24 00:21:33
|
显示全部楼层
 | 
| 派可数据官方号 | 
|
|  | 
|  |  |