我有一個Ubuntu的機器,它有一個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;
}
}