在 nginx.conf 中配置两个server即可:
http { include mime.types; default_type application/octet-stream; sendfile on; keepalive_timeout 65; gzip on; upstream localhost { server127.0.0.1:8080 max_fails=7 fail_timeout=7s; } server { listen 81; server_name localhost; location / { root html; indexindex.html index.htm; proxy_pass http://localhost; } } server { listen 80; server_name localhost; #charset koi8-r;#access_log logs/host.access.log main; location / { root html; indexindex.html index.htm; proxy_pass http://localhost; } }}
').addclass('pre-numbering').hide(); $(this).addclass('has-numbering').parent().append($numbering); for (i = 1; i ').text(i)); }; $numbering.fadein(1700); }); }); 以上就介绍了nginx 监听多个端口 80和81,包括了方面的内容,希望对php教程有兴趣的朋友有所帮助。