In my /etc/hosts
file I added an alias to localhost like this:
127.0.0.1 example.local
My wordpress server is hosted on port 8000 so I use proxy_pass
:
server{
listen 80;
server_name example.local;
root /Users/akashagarwal/Downloads/wordpress;
location / {
proxy_pass http://127.0.0.1:8000;
proxy_set_header Host $host;
}
}
There are two problems that I'm facing.
1. Upon opening http://example.local
in my browser, the address bar gets appended with :8000
.
2. Upon clicking a link, the host name gets changed to localhost:8000
.
What am I doing wrong here?
Running nginx version: nginx/1.10.3
on macOS Sierra 10.12.1
.
TIA