Try to find this problem when nginx uses different domain name proxy applications,
for example
listen 8888;
server_name www.test.com;
location ~ /testa {
proxy_pass http://beta.test.com; #apache
}
If IP is 127.0.0.1, an error will be reported
Asked the next Baidu need to set nginx resolver
The specific settings are as follows
The local MAC environment has been set
brew install dnsmasq
vim /usr/local/etc/dnsmasq.conf
Open the following comments
domain-needed
bogus-priv
cache-size=51200
listen-address=127.0.0.1
resolv-file=/etc/resolv.conf
Start up
sudo brew services start dnsmasq
Add in nginx configuration
listen 8888;
server_name www.test.com;
location ~ /testa {
resolver 127.0.0.1;
proxy_pass http://beta.test.com; #apache
}
Restart nginx again, and the access test is normal
Similar Posts:
- CentOS starts nginx and prompts nginx: [emergency] still could not bind ()
- Solve the 400 error of nginx forwarding websocket
- Solving the problem of nginx reverse proxy web service soap:address location problem
- Nginx Error when installing the startup service failed to start a high performance web server and a reverse proxy serve
- PHP FPM and Nginx start normally, page 502 Error [How to Solve]
- Nginx 400 Bad Request | The plain HTTP request was sent to HTTPS port
- [Solved] docker nginx localhost connection refused connect() failed (111: Connection refused)while connecting to upstream
- [Solved] Nginx can’t listen to the problem of virtual VIP: 99: cannot assign requested address
- Nginx error 111: connection rejected [How to Solve]
- nginx: [emerg] getpwnam(“nginx”) failed [How to Fix]