nginx配置虚拟主机
发表于:2025-12-02 作者:千家信息网编辑
千家信息网最后更新 2025年12月02日,1.基于端口的虚拟主机server { listen 80; server_name www.nginx1.com; #charset koi8
千家信息网最后更新 2025年12月02日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安全错误
数据库的锁怎样保障安全
艾米视频软件开发
国产服务器操作系统股票
博易创为服务器
自贡应用软件开发
数据库外链接关键字是什么
网宿网络技术有限公司
护苗网络安全及网络防沉迷
阿里云服务器离线
军车网络技术
普洱互联网科技可以吗
软件开发在大学好就业吗
网络安全中人是最薄弱的环节
中国台湾开源软件开发技术
中战云服务器
大学软件开发专业
郑州学习软件开发价格
大陆玩美服务器lol
sql分离的数据库
江北区软件开发培训
应届生面试软件开发工程师
软件开发实践内容
博易创为服务器
腾讯星星海服务器规模
数据库为什么要买
计算机网络技术是什么系
java软件开发和后端
华为高斯数据库中标国家机关
车载安卓系统软件开发
淘宝网站数据库技术
解说我的世界斗罗大陆服务器