I am trying to redirect any user opening an application running on my machine, to an nginx server. I have this configuration for ngins in the conf file:
This is what I tried, for example, redirecting requests from google.com to localhost:80.
upstream google {
server google.com;
}
server {
listen 80;
server_name google.com;
location / {
proxy_pass http://localhost:8080;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}
}
server {
listen 80;
server_name localhost;
location / {
# Your own server's content or application
index index.html;
}
}
But nothing happens. What am I missing?
New contributor
Laith Budairi is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.