1、首先用putty进去如192.168.18.67
2、 ps -ef | grep nginx 查看nginx位置和config位置
3、cd /usr/local/nginx/conf/ 进去 打开config 如vi nginx.conf
4、杀死之前的进程killall -9 /usr/local/nginx/sbin/nginx
5、/usr/local/nginx/sbin/nginx重新启动nginx
ngnix格式
server
{
listen 80;
server_name 192.168.2.67;
index index.html index.htm index.php;
root /home/wwwroot;
location ~ .*\.(php|php5)?$
{
try_files $uri =404;
fastcgi_pass unix:/tmp/php-cgi.sock;
fastcgi_index index.php;
include fcgi.conf;
}
location /status {
stub_status on;
access_log off;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
}
location ~ .*\.(js|css)?$
{
expires 12h;
}
access_log /home/wwwlogs/access.log access;
}