nginx配置虚拟主机
发表于:2026-11-01 作者:千家信息网编辑
千家信息网最后更新 2026年11月01日,1.基于端口的虚拟主机server { listen 80; server_name www.nginx1.com; #charset koi8
千家信息网最后更新 2026年11月01日nginx配置虚拟主机
1.基于端口的虚拟主机
server { listen 80; server_name www.nginx1.com; #charset koi8-r; #access_log logs/host.access.log main; location / { root html; index index.html index.htm; } #error_page 404 /404.html; # redirect server error pages to the static page /50x.html # error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } # proxy the PHP scripts to Apache listening on 127.0.0.1:80 # #location ~ \.php$ { # proxy_pass http://127.0.0.1; #} # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 # #location ~ \.php$ { # root html; # fastcgi_pass 127.0.0.1:9000; # fastcgi_index index.php; # fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name; # include fastcgi_params; #} # deny access to .htaccess files, if Apache's document root # concurs with nginx's one # #location ~ /\.ht { # deny all; #}}server{ listen 9527; server_name www.nginx1.com; location / { root /opt/html; index index.html index.htm index.php; }}2.基于端口的虚拟主机
server { listen 80; server_name www.nginx1.com; #charset koi8-r; #access_log logs/host.access.log main; location / { root html; index index.html index.htm; } #error_page 404 /404.html; # redirect server error pages to the static page /50x.html # error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } # proxy the PHP scripts to Apache listening on 127.0.0.1:80 # #location ~ \.php$ { # proxy_pass http://127.0.0.1; #} # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 # #location ~ \.php$ { # root html; # fastcgi_pass 127.0.0.1:9000; # fastcgi_index index.php; # fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name; # include fastcgi_params; #} # deny access to .htaccess files, if Apache's document root # concurs with nginx's one # #location ~ /\.ht { # deny all; #}}server{ listen 9527; server_name www.nginx2.com; location / { root /opt/html; index index.html index.htm index.php; }}3.基于端口的虚拟主机
#执行命令虚拟IPifconfig eth0:1 192.168.2.141 netmask 255.255.255.0
#修改nginx.conf配置文件server { listen 192.168.2.140:80; server_name 192.168.2.140; #charset koi8-r; #access_log logs/host.access.log main; location / { root html; index index.html index.htm; } #error_page 404 /404.html; # redirect server error pages to the static page /50x.html # error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } # proxy the PHP scripts to Apache listening on 127.0.0.1:80 # #location ~ \.php$ { # proxy_pass http://127.0.0.1; #} # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 # #location ~ \.php$ { # root html; # fastcgi_pass 127.0.0.1:9000; # fastcgi_index index.php; # fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name; # include fastcgi_params; #} # deny access to .htaccess files, if Apache's document root # concurs with nginx's one # #location ~ /\.ht { # deny all; #}}server{ listen 192.168.2.141:9527; server_name 192.168.2.141; location / { root /opt/html; index index.html index.htm index.php; }}
主机
虚拟主机
端口
配置
命令
文件
数据库的安全要保护哪些东西
数据库安全各自的含义是什么
生产安全数据库录入
数据库的安全性及管理
数据库安全策略包含哪些
海淀数据库安全审计系统
建立农村房屋安全信息数据库
易用的数据库客户端支持安全管理
连接数据库失败ssl安全错误
数据库的锁怎样保障安全
深圳市人人互联网科技有限公司
深圳恒合互联网络科技有限公司
互联网科技卖菜
网络科技有限互联网
互联网的科技创新
嘟嘟瓜互联网科技
互联网科技公司介绍
天扬科技互联网广告
银川新华互联网科技职业技术培训学校图片
互联网企业和科技型企业
互联网科技与管理
千方科技属于互联网企业吗
深圳无忧互联网科技
互联网相关科技技术
广州燕处互联网科技有限公司
互联网科技创新创业项目
互联网对科技影响
高科技和互联网的现代国家
互联网科技企业文化
颐高云石互联网科技
互联网科技海报
亿人帮互联网科技有限公司
盈实互联网科技
互联网络科技有限公司
鑫亿盛互联网科技
中国的互联网科技企业的崛起
中国航天科技大学国际工业互联网
乌苏新华互联网科技做什么的
浙南科技城互联网大厦招聘
广州互联网高科技取餐柜