我有一个 ubuntu 机器,它绑定了一个 IP 地址,并且我有一个要在我的虚拟主机中配置的站点。问题是如果我没有任何域指向它,我应该在我的 server_name 中输入什么?基本上我想要这样当我输入我的 IP 地址 2xx.xxx.xxx.xxx 然后它会转到这个站点。这是我当前的配置
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;
}
}