server { listen 8080; server_name ip; #charset koi8-r; #access_log logs/host.access.log main;article/list/0/json location / { if ($request_method = 'OPTIONS') { return 204; } root html/Web1; index index.html index.htm; } error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } }
这假如是原本的 只需要再次建立一个 server模块 修改端口即可
server { listen 8081; server_name ip; #access_log logs/host.access.log main;article/list/0/json location / { if ($request_method = 'OPTIONS') { return 204; } root html/Web2; index index.html index.htm; } error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } }
完事重启
标签:web,log,index,端口,server,access,Nginx,html,location From: https://www.cnblogs.com/fengfenghuifei/p/17754441.html