nginx Second, reverse proxy


#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;

    server_names_hash_bucket_size 128;

    #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  logs/access.log  main;

    sendfile        on;
    #tcp_nopush     on;

    #keepalive_timeout  0;
    keepalive_timeout  65;

    #gzip  on;

    upstream zz-public{
    server 192.168.1.125:2222;
    }
    
    upstream zz-public-api{
    #server 192.168.1.125:2222;
    server 192.168.1.125:8000;
    }
    

    #upstream zz-pay-api{
    #server 192.168.1.125:9001;
    #}
  


    server {
        listen       80;
        server_name  zz-public.zz.com;

        location / {
            proxy_pass http://zz-public;
        index  index.html index.htm;

        }
    }
    
 
  

    server {
        listen       80;
        server_name  zz-public-api.zz.com;

        location / {
            proxy_pass http://zz-public-api;
        #root   C:\Users\Administrator\Desktop\abc;
        index  index.html index.htm;

        }
    }

 

 

    server {
        listen       80;
       server_name  zz-pay-api.zz.com;

        location / {
            proxy_pass http://zz-pay-api;
       index  index.html index.htm;

   }
 

 

}
 

Published 48 original articles · won praise 26 · views 70000 +

Guess you like

Origin blog.csdn.net/qq_38316721/article/details/104891245