Nginx反向代理设置 从80端口转向其他端口

 

 

[root@localhost bin]# netstat -lnutp
Active 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 -version
java 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;
        }

    }

}

 

转载于:https://www.cnblogs.com/bass6/p/5948199.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值