IP 주소가있는 우분투 컴퓨터가 있는데 가상 호스트에서 구성하려는 사이트가 있습니다. 문제는 내가 가리키는 도메인이 없다면 server_name에 무엇을 넣어야합니까? 근본적으로 나는 나가이 IP 주소 2xx.xxx.xxx.xxx를 입력 할 때 그 때이 위치에 간다 그런 원했다. 내 현재 구성은 다음과 같습니다.도메인 이름을 지정하지 않은 경우 nginx server_name을 구성하십시오.
server {
listen 80;
server_name dev.somesite.com;
client_max_body_size 25M;
access_log /var/log/nginx/dev.somesite.com.access_log;
error_log /var/log/nginx/dev.somesite.com.error_log warn;
server_name_in_redirect off;
root /var/www/somesite-dev/web;
location/{
try_files $uri /app_dev.php?$args;
}
index app_dev.php index.php index.html;
fastcgi_index index.php;
location ~ \.php($|/) {
set $script $uri;
set $path_info "";
if ($uri ~ "^(.+\.php)(/.*)") {
set $script $1;
set $path_info $2;
}
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
include /etc/nginx/fastcgi_params;
keepalive_timeout 0;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass 127.0.0.1:9000;
}
}