Home > front end >  Help nginx problems after the reverse proxy
Help nginx problems after the reverse proxy

Time:09-30

Younger brother on the phone to try the nginx, the purpose is to want to put the 2 servers, using their native load distribution, the user to access my native address again to jump to the background of the server, but I use load function to 403 after the mistake and can't enter the password with no response, the most important is the picture also shows that not all ~ teachers, please have a look at, what to do.
The following is the configuration




# the user nobody;
Worker_processes 1;

# error_log logs/error. The log;
# error_log logs/error log notice;
# error_log logs/error. The log info;

# pid logs/nginx. Pid;


Events {
Worker_connections 1024;
}


HTTP {
. Include the mime types;
Default_type application/octet - stream;

# log_format main '$remote_addr - $remote_user [$time_local] "$request"'
# '$$body_bytes_sent status "$http_referer"'
# '" $http_user_agent "" $http_x_forwarded_for"';

# access_log logs/access. Log the main;

Sendfile on;
# tcp_nopush on;

# keepalive_timeout 0;
Keepalive_timeout 65;

# gzip on;

Upstream web {

Server 192.168.164.139:8080;
Server 111.19.238.44:80;

}

Server {
Listen, 8080;
server_name localhost;

#charset koi8-r;

#access_log logs/host.access.log main;

The location/{
Proxy_connect_timeout 2;
Proxy_send_timeout 2;
Proxy_read_timeout 2;

Proxy_set_header HOST $HOST: $server_port;
# proxy_set_header Host $proxy_host;
Client_body_buffer_size 256 k;
Client_max_body_size 100 m;
Proxy_set_header X - Real - IP $remote_addr;

proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
Proxy_set_header Upgrade - Insecure - Requests 1;



Proxy_buffer_size 256 k;
Proxy_buffers 4 256 k;
Proxy_busy_buffers_size 256 k;
Proxy_temp_file_write_size 256 k;
Proxy_next_upstream error timeout invalid_header http_500 http_503 http_404;
Proxy_max_temp_file_size 128 m;

Proxy_pass http://web;
The root HTML;
The index index. HTML index. HTML;


The location ~ \. (JPG | PNG | jpeg | BMP | | GIF SWF | CSS) $
{proxy_pass http://192.168.164.139:8080;
Proxy_set_header Host $proxy_host;
Proxy_set_header Origin "";
Proxy_http_version 1.1;
}





}

404/404 # error_page. HTML;

# redirect server error pages to the static page/50 x) HTML
#
Error_page 504/50, 500, 502, 503 x. HTML;
Location=/50 x) HTML {
The root HTML;
}

# proxy the PHP scripts to Apache listening on 127.0.0.1:80
#
# the location ~ \. PHP ${
# proxy_pass http://127.0.0.1;
#}

# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
# the location ~ \. PHP ${
# root HTML;
# fastcgi_pass 127.0.0.1:9000;
# fastcgi_index index. PHP;
# fastcgi_param SCRIPT_FILENAME/scripts $fastcgi_script_name;
# include fastcgi_params;
#}

# to deny access to...htaccess files, if the Apache 's document root
# concurs with nginx 's one
#
# the location ~/\. Ht {
# deny all;
#}
}


# another virtual host using mix of IP -, name, and port - -based configuration
#
# server {
# 8000; listen
# listen somename: 8080;
# server_name somename alias another. Alias;

# the location/{
# root HTML;
# index index. HTML index. HTM;
#}
#}


# HTTPS server
#
# server {
443 the SSL # listen;
# server_name localhost.

# ssl_certificate cert. Pem;
# ssl_certificate_key cert. Key;

# ssl_session_cache Shared: SSL: 1 m;
# ssl_session_timeout 5 m;

# ssl_ciphers HIGH:! ANULL:! MD5;
# ssl_prefer_server_ciphers on;

# the location/{
# root HTML;
# index index. HTML index. HTM;
#}
#}

}

  • Related