首页 > 代码库 > Nginx反向代理设置 从80端口转向其他端口
Nginx反向代理设置 从80端口转向其他端口
[root@localhost bin]# netstat -lnutpActive Internet connections (only servers)Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 1552/nginx tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1408/sshd tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 1487/master tcp 0 0 ::ffff:127.0.0.1:8005 :::* LISTEN 6389/java tcp 0 0 :::8009 :::* LISTEN 6389/java tcp 0 0 :::8080 :::* LISTEN 6389/java tcp 0 0 :::22 :::* LISTEN 1408/sshd tcp 0 0 ::1:25 :::* LISTEN 1487/master udp 0 0 0.0.0.0:68 0.0.0.0:* 6042/dhclient [root@localhost bin]# java -versionjava version "1.8.0_45"Java(TM) SE Runtime Environment (build 1.8.0_45-b14)Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode)
server { listen 80; server_name localhost; #charset koi8-r; #access_log logs/host.access.log main; location / { proxy_pass http://127.0.0.1:8080; #root html; #index index.html index.htm; }
网上找的一个配置:
worker_processes 1;events { worker_connections 1024;}http { include mime.types; default_type application/octet-stream; sendfile on; keepalive_timeout 65; server { listen 80; server_name 127.0.0.1:8080; location / { proxy_pass http://127.0.0.1:8080; } }}
Nginx反向代理设置 从80端口转向其他端口
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。