-
阿里云lmnp环境根据url配置端口转发可同时使用80端口访问php、java项目
2019-09-23 17:55:20由于调用了微信公众号的接口,必须使用80端口。但是已被php程序占用,所以需要使用nginx的转发功能进行配置。 功能处理 开始是先在本地进行测试,由于是mac系统,本身已有apache、php的运行环境。java是自己的...需求背景
正式服务器环境安装有一套lmnp环境,运行着discuz程序,有域名。现需要通过一套java语言的springboot项目定时修改discuz库中的数据。由于调用了微信公众号的接口,必须使用80端口。但是已被php程序占用,所以需要使用nginx的转发功能进行配置。
功能处理
开始是先在本地进行测试,由于是mac系统,本身已有apache、php的运行环境。java是自己的老本行,相关工具当然健在。在安装一个nginx环境即可。可见《MAC系统中运行mysql+apache+php环境,方便快速搭建discuz,dedecms,wordpress环境等》 也就是本地搭建了一套lmap环境 + java项目 + nginx的配置。
php端口为8081,java端口为8080,nginx监听80端口,根据url转发配置及说明如下:
= 开头表示精确匹配 ^~ 开头表示uri以某个常规字符串开头,理解为匹配 url路径即可。nginx不对url做编码,因此请求为/static/20%/aa,可以被规则^~ /static/ /aa匹配到(注意是空格)。 ~ 开头表示区分大小写的正则匹配 ~* 开头表示不区分大小写的正则匹配 !~和!~*分别为区分大小写不匹配及不区分大小写不匹配 的正则 / 通用匹配,任何请求都会匹配到。 首先匹配 =,其次匹配^~, 其次是按文件中顺序的正则匹配,最后是交给 / 通用匹配。当有匹配成功时候,停止匹配,按当前匹配规则处理请求。 server { listen 80; server_name localhost; #charset koi8-r; #access_log logs/host.access.log main; location / { proxy_pass http://localhost:8081; } location /wx/ { proxy_pass http://localhost:8080; } }
当访问localhost的时候,两个服务都可以正常访问。以为放到线上就可以了,但是不行。线上的php是用nginx启用了fastcgi相关配置来运行的,本身没有使用apache服务器。
默认配置如下,可见配置文件读取/alidata/server/nginx/conf/vhosts/*.conf目录下的error_log /alidata/log/nginx/error.log crit; pid /alidata/server/nginx/logs/nginx.pid; #Specifies the value for maximum file descriptors that can be opened by this process. worker_rlimit_nofile 65535; events { use epoll; worker_connections 65535; } http { include mime.types; default_type application/octet-stream; #charset gb2312; server_names_hash_bucket_size 128; client_header_buffer_size 32k; large_client_header_buffers 4 32k; client_max_body_size 8m; sendfile on; tcp_nopush on; keepalive_timeout 60; tcp_nodelay on; fastcgi_connect_timeout 300; fastcgi_send_timeout 300; fastcgi_read_timeout 300; fastcgi_buffer_size 64k; fastcgi_buffers 4 64k; fastcgi_busy_buffers_size 128k; fastcgi_temp_file_write_size 128k; gzip on; gzip_min_length 1k; gzip_buffers 4 16k; gzip_http_version 1.0; gzip_comp_level 2; gzip_types text/plain application/x-javascript text/css application/xml; gzip_vary on; #limit_zone crawler $binary_remote_addr 10m; log_format '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"'; include /alidata/server/nginx/conf/vhosts/*.conf; }
conf相关文件配置如下
upstream tomcat { server 127.0.0.1:8080; } #server { # listen 80; # server_name xxx.com; # location /lawwx/ { # proxy_pass http://tomcat; # } #} server { listen 80; server_name xxx.com; #index index.html index.htm index.php; root /alidata/www/; location / { index index.html index.htm index.php; root /alidata/www/; } location /lawwx/ { root /home/; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_redirect off; proxy_pass http://127.0.0.1:8080; } location ~ \.(php|php5)?$ { #fastcgi_pass unix:/tmp/php-cgi.sock; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; include fastcgi.conf; } location ~ \.(gif|jpg|jpeg|png|bmp|swf)$ { expires 30d; } location ~ \.(js|css)?$ { expires 1h; } include /alidata/server/nginx/conf/rewrite/discuz_x3.conf; access_log /alidata/log/nginx/access/ottffss.log; error_page 404 /404.html; # }
根据上面的配置,可以看到根据url路径做了对应的转发以及资源的缓存。但是每次访问的时候只能匹配到php环境。java路径始终无法匹配。把其中php相关的注释掉,就可以访问java环境功能。(应该是什么配置的不对?还是这种配置是错误的,网上几个这种的环境配置,但是拿来用依然无法使用)。如果我在安装一个apache服务器去运行php项目,在用nginx转发apache和java项目,就和本地的配置一样了。肯定可以成功。但是服务器资源紧张,不能安装其他软件了。
这里利用了二级域名处理了这个问题。www.xxx.com用来处理php业务, wx.xxx.com用来处理java业务。
做了二级域名后的配置如下
upstream tomcat { server 127.0.0.1:8080; } server { listen 80; server_name wx.xxx.com; location /lawwx/ { proxy_pass http://tomcat; } }
这样终于可以了用80端口同时访问 java、php项目了。
有经验的人,可以解答下根据url配置为啥不生效 ? -
Nginx多端口转发文件配置
2020-06-24 20:02:23Nginx多端口转发文件配置 服务器使用非80端口访问需要加端口号还是很难受的,使用域名解析来绑定也比较不划算,例如阿里云免费版的匿名转发url服务只有两个,如果使用Nginx进行转发,还是很爽的。 只需要将所有的二...Nginx多端口转发文件配置
服务器使用非80端口访问需要加端口号还是很难受的,使用域名解析来绑定也比较不划算,例如阿里云免费版的匿名转发url服务只有两个,如果使用Nginx进行转发,还是很爽的。
只需要将所有的二级域名解析到服务器的IP(阿里云域名解析到IP是没多大限制的),用Nginx进行识别访问的域名,进行转发,体验不输域名解析服务。这里给出目前在用的配置文件示例# For more information on configuration, see: # * Official English Documentation: http://nginx.org/en/docs/ # * Official Russian Documentation: http://nginx.org/ru/docs/ user nginx; worker_processes auto; error_log /var/log/nginx/error.log; pid /run/nginx.pid; # Load dynamic modules. See /usr/share/doc/nginx/README.dynamic. include /usr/share/nginx/modules/*.conf; events { worker_connections 1024; } http { 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 /var/log/nginx/access.log main; sendfile on; tcp_nopush on; tcp_nodelay on; keepalive_timeout 65; types_hash_max_size 2048; #网页使用nginx上传文件时的最大文件限制 client_max_body_size 20m; include /etc/nginx/mime.types; default_type application/octet-stream; # Load modular configuration files from the /etc/nginx/conf.d directory. # See http://nginx.org/en/docs/ngx_core_module.html#include # for more information. include /etc/nginx/conf.d/*.conf; #一条转发记录,一个server server { listen 80; #监听的端口 listen [::]:80; #服务名写入你的域名,例如二级域名,只需要在云解析服务把所有二级域 #名解析到服务器的IP,在这里会进行服务名(访问的域名)匹配 #例如以域名 t.test.com访问,就会匹配到以下服务名 server_name t.test.com; #你的需要转发的跟目录,也就是你的显示的页面的目录,算是 #index.html的文件夹,例如存在/var/www/html/test/index.html #则根目录可以写成/var/www/html/test root /var/www/html/test; # Load configuration files for the default server block. include /etc/nginx/default.d/*.conf; location / { #进入文件夹检索的转发的界面文件,左边的优先 index index.php index.html index.htm; } error_page 404 /404.html; location = /40x.html { } error_page 500 502 503 504 /50x.html; location = /50x.html { } } server { listen 80; listen [::]:80; #例如t2.test.com server_name t2.test.com; #需要转发/var/www/html/t2/index.html root /var/www/html/t2; # Load configuration files for the default server block. include /etc/nginx/default.d/*.conf; location / { index index.php index.html index.htm; } error_page 404 /404.html; location = /40x.html { } error_page 500 502 503 504 /50x.html; location = /50x.html { } } #转发php网页,需要安装并开启php的组件 server { listen 80; listen [::]:80; #例如php.test.com server_name php.test.com; #如果需要转发/var/www/html/php/index.php root /var/www/html/php; # Load configuration files for the default server block. include /etc/nginx/default.d/*.conf; location / { index index.php index.html index.htm; } location ~ .php$ { root /usr/share/nginx/html/wordpress; #将/usr/share/nginx/html替换为您的网站根目录,本教程使用/usr/share/nginx/html作为网站根目录 fastcgi_pass 127.0.0.1:9000; #Nginx通过本机的9000端口将PHP请求转发给PHP-FPM进行处理 fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; #Nginx调用fastcgi接口处理PHP请求 } error_page 404 /404.html; location = /40x.html { } error_page 500 502 503 504 /50x.html; location = /50x.html { } } # Settings for a TLS enabled server. # # server { # listen 443 ssl http2 default_server; # listen [::]:443 ssl http2 default_server; # server_name _; # root /usr/share/nginx/html; # # ssl_certificate "/etc/pki/nginx/server.crt"; # ssl_certificate_key "/etc/pki/nginx/private/server.key"; # ssl_session_cache shared:SSL:1m; # ssl_session_timeout 10m; # ssl_ciphers HIGH:!aNULL:!MD5; # ssl_prefer_server_ciphers on; # # # Load configuration files for the default server block. # include /etc/nginx/default.d/*.conf; # # location / { # } # # error_page 404 /404.html; # location = /40x.html { # } # # error_page 500 502 503 504 /50x.html; # location = /50x.html { # } # } }
-
Nginx端口转发简明配置
2020-09-23 15:11:21Nginx端口转发简明配置 最近想要实现蜜罐运维端口的跨区转发(A区,C区不通,走B区中转实现 A到B到C的运维)。看完官方文档和几篇不错的博客后,现小结记录,方便以后快速配置Nginx转发相关功能。 Nginx是一款轻量...Nginx端口转发简明配置
最近想要实现蜜罐运维端口的跨区转发(A区,C区不通,走B区中转实现 A到B到C的运维)。看完官方文档和几篇不错的博客后,现小结记录,方便以后快速配置Nginx转发相关功能。
Nginx是一款轻量化但功能丰富的中间件,可作为HTTP服务器,也可作为反向代理服务器,邮件服务器。它不仅支持FastCGI、SSL、Virtual Host、URL Rewrite、Gzip等功能,还可以结合openresty等丰富的第三方扩展实现云waf等等各种高级操作。
nginx配置文件常见结构
nginx配置文件默认位置
/etc/nginx/nginx.conf
,一般结构如下... # 全局设置 events { # events块,用于设置nginx工作模式,配置影响nginx服务器或与用户的网络连接。有每个进程的最大连接数,选取哪种事件驱动模型处理连接请求,是否允许同时接受多个网路连接,开启多个网络连接序列化等。 .... } http { # http块,可以包含多个server和upstream .... upstream back { # 负载均衡上游服务器,后面可以通过变量back调用 ..... } server { # 主机配置:主要包含监听端口,路由选择等 .... location / { # location,路由配置 .... } }
nginx转发http
这是目前网上各种博客讲的最多的东西,做WEB类的负载均衡和网页转发用的比较多,能搜到实例非常多。主要是配置http块
http { include mime.types; #文件扩展名与文件类型映射表 default_type application/octet-stream; #默认文件类型,默认为text/plain #access_log off; #取消服务日志 log_format myFormat '$remote_addr–$remote_user [$time_local] $request $status $body_bytes_sent $http_referer $http_user_agent $http_x_forwarded_for'; #自定义格式 access_log log/access.log myFormat; #combined为日志格式的默认值 sendfile on; #允许sendfile方式传输文件,默认为off,可以在http块,server块,location块。 sendfile_max_chunk 100k; #每个进程每次调用传输数量不能大于设定的值,默认为0,即不设上限。 keepalive_timeout 65; #连接超时时间,默认为75s,可以在http,server,location块。 upstream mysvr { server 127.0.0.1:7878; server 192.168.10.121:3333 backup; #热备 } error_page 404 https://www.baidu.com; #错误页 server { keepalive_requests 120; #单连接请求上限次数。 listen 4545; #监听端口 server_name 127.0.0.1; #监听地址 location ~*^.+$ { #请求的url过滤,正则匹配,~为区分大小写,~*为不区分大小写。 #root path; #根目录 #index vv.txt; #设置默认页 proxy_pass http://mysvr; #请求转向mysvr 定义的服务器列表 deny 127.0.0.1; #拒绝的ip allow 172.18.5.54; #允许的ip } } }
nginx转发TCP/UDP
nginx最常见的用法是转发七层的web服务。从1.9.0之后的版本,nginx加入stream模块,支持四层协议TCP的转发,1.9.3之后支持UDP的转发。其实有了这个功能之后其实完全可以使用stream模块转发HTTP,放弃http模块。
需要注意的是,现在通过yum安装应该是有stream模块的,如果通过源码安装,可能编译的时候要加上stream模块
./configure --prefix=/usr/local/nginx --with-stream make && make install
下面是样例配置
stream { # 可以按需求配置日志 log_format proxy '$remote_addr [$time_local] ' '$protocol $status $bytes_sent $bytes_received ' '$session_time "$upstream_addr" ' '"$upstream_bytes_sent" "$upstream_bytes_received" "$upstream_connect_time"'; access_log /var/log/nginx/tcp-access.log proxy ; # tcp转发的上游 upstream backend { hash $remote_addr consistent; server 127.0.0.1:12346 weight=5; server 127.0.0.1:12347 max_fails=3 fail_timeout=30s; server 127.0.0.1:12348 max_fails=3 fail_timeout=30s; } # udp转发的上游 upstream dns { # 多台DNS server HA server 17.61.29.79:53; server 17.61.29.80:53; server 17.61.29.81:53; server 17.61.29.82:53; } # tcp转发的虚拟server server { listen 12345; # 监听端口 proxy_connect_timeout 1s; proxy_timeout 3s; proxy_pass backend; # 转发12345端口到上游的backend } # udp转发的虚拟server server { listen 127.0.0.1:53 udp; # 监听端口 proxy_responses 1; # nginx等待的回包数量 proxy_timeout 20s; proxy_pass dns; # 转发端口 }
端口转发完整配置样例
虽然stream模块是转发四层的,http模块转发七层,存在包含关系。但其实两者同时配置是可以正常工作的。stream块和http块是允许并列存在。如下配置为把7003端口转发到 172.33.1.22的ssh服务(port22)上,同时把本地7002端口转发到 www.fucguigui.com的80口。
# For more information on configuration, see: # * Official English Documentation: http://nginx.org/en/docs/ # * Official Russian Documentation: http://nginx.org/ru/docs/ user nginx; worker_processes auto; error_log /var/log/nginx/error.log; pid /run/nginx.pid; # Load dynamic modules. See /usr/share/doc/nginx/README.dynamic. include /usr/share/nginx/modules/*.conf; events { worker_connections 1024; } stream { upstream lssh{ server 172.33.1.2:22; } server { listen 7003; proxy_pass lssh; # 也支持socket # proxy_pass unix:/var/lib/mysql/mysql.socket; } } http { 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 /var/log/nginx/access.log main; sendfile on; tcp_nopush on; tcp_nodelay on; keepalive_timeout 65; types_hash_max_size 2048; include /etc/nginx/mime.types; default_type application/octet-stream; upstream fucguigui{ server www.fucguigui.com; } # Load modular configuration files from the /etc/nginx/conf.d directory. # See http://nginx.org/en/docs/ngx_core_module.html#include # for more information. include /etc/nginx/conf.d/*.conf; server { listen 7002 default_server; listen [::]:7002 default_server; server_name _; # root /usr/share/nginx/html; # Load configuration files for the default server block. include /etc/nginx/default.d/*.conf; location / { proxy_pass http://fucguigui; } error_page 404 /404.html; location = /40x.html { } error_page 500 502 503 504 /50x.html; location = /50x.html { } } # Settings for a TLS enabled server. # # server { # listen 443 ssl http2 default_server; # listen [::]:443 ssl http2 default_server; # server_name _; # root /usr/share/nginx/html; # # ssl_certificate "/etc/pki/nginx/server.crt"; # ssl_certificate_key "/etc/pki/nginx/private/server.key"; # ssl_session_cache shared:SSL:1m; # ssl_session_timeout 10m; # ssl_ciphers HIGH:!aNULL:!MD5; # ssl_prefer_server_ciphers on; # # # Load configuration files for the default server block. # include /etc/nginx/default.d/*.conf; # # location / { # } # # error_page 404 /404.html; # location = /40x.html { # } # # error_page 500 502 503 504 /50x.html; # location = /50x.html { # } # } }
踩坑记录
- 配置文件中不同server使用相同端口
nginx -t
检查策略文件可以通过,但是启动服务的时候会失败,注意检查。 - udp转发中,如果不设置
proxy_response
参数的话,短时间转发大量udp的时候会占用连接,造成worker_connections are not enough
,具体可参考sof 上老哥的描述。如果是转发dns,设置proxy_response 1
即可,如果是是转发日志这种设置proxy_response 0
就可以了。
参考资料
Nginx 配置详解 (其实并不详,讲转发http的)
Nginx中文文档 (较详细,但完整例子零散)
- 配置文件中不同server使用相同端口
-
local.dev:允许将localhost:port重命名为任何可能的URL,也可以是本地主机的端口转发-源码
2021-02-03 18:58:02仅在Windows上适用于多端口转发 ! Mac用户,请在安装软件包之前阅读已知问题部分。 在localhost上进行端口转发和重命名变得容易 Local.dev为您提供了一个简单的命令行,通过在localhost上提供简单持久的端口来... -
“域名:端口“形式的URL显性及隐性转发
2020-09-12 12:33:38URL转发 / URL显性转发 / URL隐性转发 / URL隐性转发服务器拒绝连接 域名:端口模式如何映射到二级域名 Docker映射端口如何以域名形式访问 项目场景: 在阿里云服务器的Ubuntu系统中,基于Apache2+Docker搭建的...关键词:
URL转发 / URL显性转发 / URL隐性转发 / URL隐性转发服务器拒绝连接
域名:端口模式如何映射到二级域名
Docker映射端口如何以域名形式访问
项目场景:
在阿里云服务器的Ubuntu系统中,基于Apache2+Docker搭建的服务器,其访问形式为域名:端口模式。
例如:利用Docker搭建的服务器,并将服务器8555端口映射至Docker容器。同时在阿里云上开放8555端口的访问权限。假设服务器域名已经备案,且其地址为www.example.com。
那么访问本次Docker搭建的服务器,其url网址则为www.example.com:8555
问题描述:
在让客户访问某个网站时,我们期望的客户能以产品(二级域名)+主域名的形式访问,这样有利于客户记住网站地址。
很显然,www.example.com:8555这种域名:端口的访问形式非常不利于记忆和传播。为了解决这一尴尬的现象,就需要使用阿里云服务器上的URL转发。
URL转发包括显性转发和隐性转发。
首先,需要管理员在阿里云操控台上,进入域名解析设置页面,添加一个新的解析:- 记录类型:显性URL转发/隐性URL转发
- 主机记录:product
- 记录值:www.example.com:8555
- 解析线路:默认
- TTL:10分钟
这样设置完成之后,阿里云端的URL转发配置就完成了
- 对于显性URL转发而言:在网址栏输入product.example.com时,将自动跳转进入www.example.com:8555,并在新页面显示的网址为www.example.com:8555。
- 对于隐性URL转发而言:在网址栏输入product.example.com时,同样会进入www.example.com:8555,但是其新页面将会一直保持显示product.example.com。
但URL隐性转发的解析配置完成后,直接访问product.example.com时,会发现服务发生了拒绝连接的现象。
原因分析:
Apache服务器为了防止网站被劫持,一般是不允许进行域名隐性转发的操作。因此,即便在阿里云上设置了隐性URL转发,服务器仍然会返回拒绝连接的情况。
解决方案:
进入Docker镜像中,对Docker内的Apache配置进行更改(注意:不是更改阿里云服务器的Apache配置)
[在阿里云root中操作] docker exec -it [你的容器ID] /bin/bash [在dockerID容器中操作] vim /etc/apache2/apache2.conf # 在最后一行添加: [在apache2.conf文件中操作] Header set X-Frame-Options "allow-from [你的域名]" 如: [在apache2.conf文件中操作] Header set X-Frame-Options "allow-from http://www.example.com/" [在apache2.conf文件中操作]保存并退出 [在dockerID容器中操作] /etc/init.d/apache2 restart [在dockerID容器中操作] 同时按住Ctrl + Q + P退出容器
注意:
让网站能接受URL隐性转发,修改前端文件的meta标签是没有任何效果的。如何基于Ubuntu + Apache + Docker 搭建服务器完整教程见下期
-
巧用netsh命令实现端口转发(端口映射)不求人
2016-11-11 23:31:34from : ... 巧用netsh命令实现端口转发(端口映射) 好处:即时生效,随意修改删除,不影响其他ip... -
Linux之Centos安装Nginx做TCP代理(端口转发)
2020-11-18 09:15:23nginx在1.9版本之后可以充当端口转发的作用,即:访问该服务器的指定端口,nginx就可以充当端口转发的作用将流量导向另一个服务器,同时获取目标服务器的返回数据并返回给请求者。nginx的TCP代理功能跟nginx的反向... -
git bash使用端口转发连接服务器
2017-08-29 20:23:00之前的配置是 url = user@xx.xx.xx.xx:/home/tutu/thelib/ww....但是现在服务器没有自己的外网,需要通过服务器yy.yy.yy.yy的端口8822进行转发,转发到zz.zz.zz.zz:22 此时,根据https://stackoverflow.com/qu... -
nginx实现同一端口url转发到多个端口和服务器备份(公司附件无法上传)
2013-05-16 13:49:34proxy_pass http:// 100.200.130.79:8088/test(转发服务器url); } #error_page 404 /404.html; # redirect server error pages to the static page /50x.html # error_page 500 502 503 504 /50x.html; ... -
nginx1.9+做TCP代理(端口转发)
2017-11-27 13:26:00nginx的TCP代理功能跟nginx的反向代理不同的是:请求该端口的所有流量都会转发到目标服务器,而在反向代理中可以细化哪些请求分发给哪些服务器;另一个不同的是,nginx做TCP代理并不仅仅局限于WEB的URL请求,还可以... -
【新手上路】Ubuntu安装配置nginx并设置端口转发
2018-04-12 23:54:05访问时通过不同的URL的将请求转发到相应的Springboot项目里进行处理。这就需要用到Nginx来做一个反向代理,监听81端口,将81端口的请求转发,从而实现目的。服务器环境为:Ubuntu 14.04.1 LTS1. 为Ubuntu安装Nginx... -
Apache通过http_proxy配置Tomcat(负载均衡/端口转发)
2014-08-26 10:41:26[端口转发配置] 通过http_proxy做tomcat的端口转发: 描述:将远程服务器映射到本地服务器的URL空间 语法:ProxyPass [路径] !|url [键=值 键=值 ...]] [nocanon] 上下文: server config, virtual ... -
nginx-UrlRewrite 实现URL重写转发
2021-03-10 13:41:39nginx 需要把http://localhost/api/getUser 转换成后端的访问端口及路由,例如:http://localhost:8080/getUser,从而访问服务。 这里就涉及到一个URL重写的的概念,可以使用多种方式来实现,那么这里由于前端程序时... -
在当前进程中使用k8s端口转发
2019-01-17 01:59:18serverURL) forwarder, err := portforward.New(dialer, []string{flagPort}, stopChan, readyChan, out, errOut) if err != nil { panic(err) } /* From here, I can make a curl to ... -
是否可以从端口转发访问recaptcha?
2016-10-24 07:27:00<p>I believe the problem is that I am allowing access to my inital url, so when I'm requesting the Captcha from my proxy it result in the Invalid domain. How do I go about letting google reCaptcha ... -
iptables实现端口转发、端口映射与双向通路
2010-04-17 01:01:46linux rhel5.4,运行php开发的一个打折购物网:[color=black][url=http://www.spzhekou.com]尚品折扣[/url][/color],数据库部署到内网中,每次导入数据都要ssh到公网,然后再转到内网。一次采集了一些服装品牌的... -
【nginx配置】nginx做非80端口转发
2015-12-11 14:35:00搭建成功后,因为Tomcat监听的端口是8080,因此,访问的URL前缀是localhost:8080,每次访问项目的时候都要先输入这一串内容,感觉比较繁杂,所以想着将其变成localhost来访问,但是这样的话就是访问80端口了,要达到... -
squid端口转发_Squid服务器三种代理方式详解
2020-12-22 22:42:28ACL(Access Control List,访问控制列表)可以从客户机的IP地址、请求访问的URL/域名/文件类型、访问时间、并发请求数等各方面进行控制。配置文件:http_port 3128 transparent应用访问控制的方式定义acl列表acl列表... -
nginx使用非80端口时url带端口号的解决办法
2020-09-02 18:25:15在nginx中配置server侦听非80端口时,我们在访问时会在url中加入对应的端口号,如:http://xxx.xxx.xxx:8080/,但如果在nginx服务器前有另一台服务器作为用户首先访问的web服务器,这台服务器设置了端口转发,将80... -
mac本地后台调试微信小程序(思路:dmz+端口转发+https+域名解析)
2017-01-07 19:31:28过去做微信开发,本地后台调试用sunny-ngrok做域名解析和端口转发简直是轻松加愉快,不过最近sunny-ngrok自定义域名有些问题,而且不支持https,没辙只能另寻他法。 需要的资源: mac电脑(习惯mac os了,其他系统... -
Apache+Weblogic实现URL转发
2020-09-15 18:55:36由于项目部署在Weblogic应用服务器上,用户访问的时候需要加端口号,这就非常的不友好了,所以又架设了Apache,使用URL转发方式来处理这个问题,本文是记录一下方法,给需要的小伙伴参考下 -
配置nginx方向代理,实现URL隐形转发 (附带nginx配置文件详解)
2018-07-31 17:03:33配置nginx方向代理,实现URL隐形转发 (附带nginx配置文件详解) 项目名称:【域名解析–隐形URL转发】–centos 7.3 环境: 阿里云服务器之上有多个tomcat; tomcat的网站基于ip+端口开发+项目名名称... -
如何设置OpenShift的端口转发(Port Forwarding)
2012-08-20 16:22:45[size=x-large][color=blue]什么是OpenShift?...[/color][/size] ...请参见[url=http://www.jiani.info/2012/08/%e5%a6%82%e4%bd%95%e6%b3%a8%e5%86%8copenshift%e5%92%8c%e5%88%9b%e5%bb%ba%e5%ba%94%e7%94%... -
求助nginx如何转发到8080端口但不改变显示的url
2015-01-08 09:08:15TOMCAT是8080端口 nginx是80端口 输入网址后默认访问的是80端口 也就是nginx 我想要nginx帮我自动转发到8080端口 但是url地址不会显示成 www.网址.com:8080 这样 求大神帮助 -
nginx反向代理之将80端口请求转发到8080
2021-01-10 07:30:15反向代理的意思是以代理服务器(这里也就是nginx)来接收网络上的请求,也就是url(默认是80端口), 1,nginx通过对url里面的一些判断(转达规则配置在nginx配置文件中),比如端口号(nginx默认是80)有可能是对二... -
自己购买的域名如何设置子域名,如何设置访问多个项目,万网域名如何设置显性url转发和隐性URL转发,以及...
2020-03-26 17:40:00自己购买的域名如何设置子域名,如何设置访问多个项目,万网域名如何设置显性url转发和隐性URL转发。 准备工作 1、有一台服务器 2、有一个域名 多项目转发 1、通过自己的域名后面加项目名来完成,这个最简单。 比如...