nginx.confserver {listen 18080 default_server;#listen [::]:8999 default_server;server_name _;root /opt;# Load configuration files for the default server block.include /etc/nginx/allowIP.conf; #此处为重点,可以引入外部配置文件,也可以在此处直接配置error_page 404 /404.html;location = /40x.html {}error_page 500 502 503 504 /50x.html;location = /50x.html {}}
allowIP.conf# 允许部分ip访问allow 218.246.127.156;allow 106.121.165.109;# 禁止其余ip访问deny all;
