Nginx configuration polling Service
We usually use the polling service when applying Nginx as a proxy.
# Set the polling name
Upstream bkjia {
Server 127.0.0.1: 8080 # apache service on the local machine
}
Server {
Listen 80;
Server_name test.com;
Root/test;
Location /{
Proxy_set_header Host $ host;
Proxy_set_header X-Real-IP $ remote_addr;
Proxy_set_header X-Forwraded-For $ remote_addr;
Proxy_pass http: // php_server;
}
# When our path contains bkjia, We will access the tomcat port corresponding to the service machine 127.0.0.1: 8081/bkjia.
Location/bkjia {
Proxy_pass http: // 127.0.0.1: 8081/bkjia; proxy_set_header Host $ host; proxy_set_header X-Forwarded-For $ proxy_add_x_forwarded_for;
}
# If the above bkjia is not matched, go to the service below and access our local apache server.
Location /{
Proxy_pass http: // bkjia;
}
}
For more Nginx tutorials, see the following:
Deployment of Nginx + MySQL + PHP in CentOS 6.2
Build a WEB server using Nginx
Build a Web server based on Linux6.3 + Nginx1.2 + PHP5 + MySQL5.5
Performance Tuning for Nginx in CentOS 6.3
Configure Nginx to load the ngx_pagespeed module in CentOS 6.3
Install and configure Nginx + Pcre + php-fpm in CentOS 6.4
Nginx installation and configuration instructions
Nginx log filtering using ngx_log_if does not record specific logs
Nginx details: click here
Nginx: click here
This article permanently updates the link address: