- Ubuntu 2204
- PHP 8.1
- Nginx 1.18.0
apt -y install php-fpm php-mysql php-json php-gd php-xml php-mbstring php-zip php-curl
apt -y install nginx
git clone https://gitee.com/zw135113/ip_lookup.git
/etc/nginx/sites-enabled/ip_lookup.conf
server {
listen 80;
server_name 10.0.0.200;
root /apps/ip_lookup;
index index.php index.html index.htm;
location / {
try_files $uri $uri/ /index.php?$args;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php8.1-fpm.sock;
}
}
加载配置文件
nginx -s reload