美文网首页
nginx反向代理

nginx反向代理

作者: yellow_han | 来源:发表于2018-08-15 10:17 被阅读0次

配置文件

user  nginx;
worker_processes  1;

error_log  /var/log/nginx/error.log warn;
pid        /var/run/nginx.pid;

events {
    worker_connections  1024;
}


http {
    include       mime.types;
    default_type  application/octet-stream;

    access_log  logs/access.log;

    sendfile        on;

    keepalive_timeout  65;

    gzip  on;

    server {
        listen 80;
        server_name dev.hsshy.cn;       
        location / {
            root    d:/test/;
        }
    }

    server {
        listen       80;
        server_name  test.hsshy.cn;
        
        location / {
            proxy_pass   http://xxx.xx.xx.xxx:8082/;
        }

        location /buy {
            proxy_pass   http://xxx.xx.xx.xx:8081/;
        }               

        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }

    }
}

相关文章

网友评论

      本文标题:nginx反向代理

      本文链接:https://www.haomeiwen.com/subject/uiuibftx.html