3
나는 최근에 (데비안) nginx 1.2.1로 업그레이드했고 이제는 nginx가 기본 서버로 항상 응답해야하는 것처럼 보입니다.nginx가 왜 지금도 기본 사이트로 응답하는 이유는 무엇입니까?
는
server {
listen 80 default_server;
server_name _;
server_name_in_redirect off;
proxy_intercept_errors on;
return 401;
}
을 /etc/nginx/conf.d /etc/nginx/sites-enabled/search.config
server {
listen 80; ## listen for ipv4
server_name search.example.com;
location/{
proxy_pass http://search.example.com:8080;
proxy_set_header X-Real-IP $remote_addr;
}
}
내가 액세스하려고 : http://search.example.com이 나에게 줄 것이다 401 대신 포트 8080 (직접 사용하는 경우 작동 함)에 있습니다. 의 nginx 배포판이 디렉토리를 사용하지 않기 때문에, 그것은로드되지 않은
또한 nginx.conf 교체 실제'include sites-enabeld/*. config' 라인은 설정 어딘가에 있습니다. (더 전형적인 엔딩은'* .conf' 일 것이다.) – Gnarfoz
나도 안다.하지만 mc는'conf'가 아니라'config'를 사용하는 경우에만 파일을 적절히 강조한다. 이것에 시간 낭비를 고려해, 어쩌면 그런 좋은 아이디어가 아니었다. – sorin
음, vim의 설정을 조정할 수있을뿐만 아니라'include 사이트 사용/* .config'와 같이 보이도록'nginx.conf'의'include' 라인을 변경할 수 있습니다. ;-) – Gnarfoz