Nginx 如何添加虛擬主機(jī)_Web服務(wù)器教程
兩個(gè)虛擬主機(jī),純靜態(tài)
- http {
- index index.html;
- server {
- server_name www.domain1.com;
- access_log logs/domain1.access.log main;
- root /var/www/domain1.com/htdocs;
- }
- server {
- server_name www.domain2.com;
- access_log logs/domain2.access.log main;
- root /var/www/domain2.com/htdocs;
- }
- }
A Default Catchall Virtual Host
- http {
- index index.html;
- server {
- listen 80 default;
- server_name _;
- access_log logs/default.access.log main;
- server_name_in_redirect off;
- root /var/www/default/htdocs;
- }
- }
指定所有的二級(jí)域名
- server {
- # Replace this port with the right one for your requirements
- listen 80 [default|default_server]; #could also be 1.2.3.4:80
- # Multiple hostnames separated by spaces. Replace these as well.
- server_name star.yourdomain.com *.yourdomain.com; # Alternately: _
- root /PATH/TO/WEBROOT/$host;
- error_page 404 errors/404.html;
- access_log logs/star.yourdomain.com.access.log;
- index index.php index.html index.htm;
- # serve static files directly
- location ~* \.(jpg|jpeg|gif|css|png|js|ico|html)___FCKpd___2nbsp;{
- access_log off;
- expires max;
- }
- location ~ \.php___FCKpd___2nbsp;{
- include fastcgi_params;
- fastcgi_intercept_errors on;
- # By all means use a different server for the fcgi processes if you need to
- fastcgi_pass 127.0.0.1:YOURFCGIPORTHERE;
- }
- location ~ /\.ht {
- deny all;
- }
- }
相關(guān)Web服務(wù)器教程:
- 推薦!各類建站程序偽靜態(tài)規(guī)則代碼
- 詳細(xì)的DedeCMS(織夢(mèng))目錄權(quán)限安全設(shè)置教程
- iis安全設(shè)置全方位教程
- 巧妙出招致勝服務(wù)器管理
- Win Server 2003個(gè)人網(wǎng)絡(luò)服務(wù)器安全攻略
- Windows 2003校園Web服務(wù)器常見問題
- 清除IIS配置文件后門隱患
- Web服務(wù)器和應(yīng)用程序服務(wù)器有什么區(qū)別
- 虛擬主機(jī)下asp.net 2.0的導(dǎo)航控件treeview,menu等出錯(cuò)
- IIS6.0服務(wù)器架站無法訪問解決方案總結(jié)
- 圖解支持多語言環(huán)境的IIS服務(wù)器配置
- IIS服務(wù)器排錯(cuò)指南及錯(cuò)誤代碼大全
- 相關(guān)鏈接:
- 教程說明:
Web服務(wù)器教程-Nginx 如何添加虛擬主機(jī)。