1. 程式人生 > >nginx中,配置ip多埠訪問

nginx中,配置ip多埠訪問

1、新增server

server {
        listen       8001;
	server_name  localhost;
        root   /home/ebayerp;
        
	location / {
            index  index.html index.htm index.php;
        }
        
	location ~ \.php$ {
           # root           "/home/ebayerp";
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_index  index.php;
	#   fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;
	    fastcgi_param  SCRIPT_FILENAME $document_root$fastcgi_script_name;
            include        fastcgi_params;
        }

	access_log /home/wwwlogs/ebayerp-access.log;
}

重啟nginx服務,效果如下
在這裡插入圖片描述

如果訪問不了,檢視
在這裡插入圖片描述

設定關閉:
在這裡插入圖片描述

即可訪問。