I've registered a domain with NameCheap and have set up an A redirect to my web server. Visiting the server directly (http://1.2.3.4
) is fine, but going through the domain name returns 400 Bad Request
from nginx.
What could I be doing wrong?
Here's the relevant part of the nginx config file.
server {
listen 80;
server_name localhost mydomain.org www.mydomain.org;
location /tile/ {
proxy_set_header Host $http_host;
proxy_pass http://127.0.0.1:20008;
}
location /datasource/ {
proxy_set_header Host $http_host;
proxy_pass http://127.0.0.1:20008;
}
location /maps {
alias /usr/share/nginx/www/Project-OSRM-Web/WebContent/;
}
location /tilemill {
rewrite ^(.*)$ http://<myhardcoded IP address>:5002 permanent;
}
location / {
alias /usr/share/nginx/www/Project-OSRM-Web/WebContent/;
}
}
No entries appear in /var/log/nginx/access.log
or /var/log/nginx/error.log
.
EDIT
More information: even with debugging switched on, nothing shows up in error.log when accessing mydomain.org - not a single line of output. However, accessing www.mydomain.org (which is set up identically at namecheap) works, and produces many pages of output.
Hmm. Ok, it's finally working. Shutting down nginx, waiting a minute, then starting it again did the trick. Previously I had been using sudo service nginx restart
.
nslookup
?