nginx pan-Domain Name

2010-04-05  来源:本站原创  分类:Internet  人气:230 

In the dns to do a general reference to the host, using nginx to do two domain rewirte

For example music.afen.cn / index.php? Id = 1 to www.afen.cn/music/index.php?id=1

server (
listen 80;
server_name www.afen.cn;
access_log off;
root / usr / www / afen /;

location / (
index index.php index.html index.htm;
)

)

server (

server_name ~^(.*) \. afen \. cn $;
set $ name $ 1;
rewrite ^ http://www.afen.cn/ $ name $ request_uri;
)

相关文章
  • nginx secondary domain name matches the root directory of the sub-folders 2010-05-24

    Binding domain server_name *. abcd.com; Get host name if ($ host ~ * (.*) \ .(.*) \ .(.*)) ( set $ domain $ 1; ) Definition List root html / abc / $ domain /; location / ( root html / abcd / $ domain; index index.html index.php; ) -------------------

  • nginx unified domain approach 2010-09-09

    Requirements: test.com will be redirected to www.test.com, empathy test.com/post/1 will be redirected to the www.test.com/post/1 last - basically using the Flag break - stop Rewrite, not to match redirect - return to temporary redirect HTTP status 30

  • how to config Apache for many domain name 2010-09-16

    ServerAlias: Server alias in Apache can be used to set the virtual host computer is a domain name, you can resolve the domain name for receiving pan. Specific settings as follows: First, to set the virtual host multiple domain names to receive A virt

  • php管理nginx虚拟主机shell脚本实例 2014-07-24

    这篇文章主要介绍了php管理nginx虚拟主机shell脚本的实现方法,以实例形式讲述了通过PHP脚本管理nginx虚拟主机的方法,具有不错的借鉴价值,需要的朋友可以参考下 本文实例讲述了php管理nginx虚拟主机shell脚本,分享给大家供大家参考.具体分析如下: 使用php作为shell脚本是一件很方便的事情.理所当然,我们可以使用php脚本来管理 nginx虚拟主机,下面是笔者的 脚本 文件供各位参考: #!/usr/bin/php -q <?php start: fwrite(STDO

  • Nginx 虚拟主机 配置 支持独立urlwrite 文件, php-fpm独立用户和php.... 2011-09-23

    Nginx 虚拟主机 环境配置. 最近租了台服务器,准备做一些网站.纠结apache/nginx很久,最后选定了Nginx+php-fpm. 因为可能会有几个站,为了安全,我希望每个站点直接都能尽量独立,避免互相影响. 主要实现功能: -能够相对快捷的添加虚拟主机. -每个虚拟主机直接相对独立,避免一个网站有漏洞,全服务器手影响 -能够方便的配置urlrewrite,还是需要reload或restart ( 谁让nginx 不支持像 .htaccess 这样吗方便的东西呢?) -每个虚拟主机能独

  • How to Pan-domain binding (javaidc) 2010-05-07

    Many companies have set up a number of Web sites to meet the needs of employees in the work, to save money, Zhexiewangzhan usually Caiyongxuni host technology, that is, set up a server with multiple websites, the staff access to those sites using the

  • Nginx on the same IP. The same port. Different domain forwarding 2010-08-18

    In the default Nginx Proxy is behind the Real Server can only do port forwarding, domain forwarding and not do. If you want to use Nginx on the back end is the same IP, same port forwarding will need to configure a different domain name Nginx Proxy.

  • nginx configuration to prevent multiple domain blind jump when there is no www 2010-11-03

    nginx installed, the default nginx.conf only one server configuration. Generally like Jiangzi of: server { listen 80; server_name www.91loli.com; index index.html index.htm index.php; root /home/www; location ~ .*\.(php|php5)?$ { fastcgi_pass unix:/t

  • Domain names point to 127.0.0.1 in the pan 2010-11-29

    Doing the second level domain to support the project, the need to configure multiple domain names point to 127.0.0.1, and the second level domain is a dynamic increase. In the change / etc / hosts when there is such a demand would be: 127.0.0.1 *. do

  • nginx pseudo-static redirection, including the domain name. directory. files and other methods 2011-05-20

    Web site construction needs in many cases of redirection: structural changes, such as web directory, web page rename, change the extension page, and changes in this domain. If you do not do redirection, user favorites and search engine database in th

  • multi domain nginx configuration to prevent the blind do not jump at www 2010-11-03

    nginx installed, the default nginx.conf only one server configuration. Jiangzi generally like this: server { listen 80; server_name www.91loli.com; index index.html index.htm index.php; root /home/www; location ~ .*\.(php|php5)?$ { fastcgi_pass unix:

  • Nginx reverse proxy multiple domain names 2011-04-12

    Nginx reverse proxy multiple domain names, domain names need to bring proxy access, then just add in the location proxy_set_header Host $host; Can.

  • nginx redirects including pseudo-static domain name directory files and other methods 2011-05-20

    Web site building needs to redirect many cases: structural changes, such as web directory, rename the page, change the extension page, domain and changes. If we did not redirect the user's collection and the search engine database so that visitors to

  • [Turn] the use ServerAlias ​​in Apache Setting virtual host name to receive more than one domain name and set the pan Resolution 2011-06-27

    Original Address: http://hi.baidu.com/yhs2006/blog/item/a137fc19e6519775dab4bddb.html serverAlias: server alias in the Apache virtual host can be used to set the receiver to a domain name, you can resolve the domain name for receiving the pan. Specif

  • Remember my first configure Apache server domain name resolution and domain name resolution process of the Pan- 2010-03-31

    Configuring apache for multiple domain name resolution, need to use the following things: C: \ WINDOWS \ system32 \ drivers \ etc \ hosts (DNS domain name resolution files) Apache2.2.11 \ conf \ httpd.conf Apache2.2.11 \ conf \ extra \ httpd-vhosts.c

  • Nginx IP and port-based load balancing 2011-05-14

    www.greatwqs.com and blog.greatwqs.com domain name servers are pointing to where Nginx IP. User access http://www.greatwqs.com , load balancing to 192.168.1.2:80,192.168.1.3:80,192.168.1.4:80,192.168.1.5:80 its four servers. User access http://blog.g

  • Ubuntu8.04 nginx mongrel mongrel_cluster erection Cluster Server 2009-04-01

    Ubuntu8.04 nginx mongrel mongrel_cluster erection Cluster Server Engage in a day, and finally Finished , and also understand a number of slightly utuntu order. Units 1 to set up nginx + mongrel servers, mongrel_cluster used to configure the cluster.

  • Nginx to do with the front-end load balancing 2010-01-19

    #user nobody; worker_processes 1; #error_log logs/error.log; #error_log logs/error.log notice; #error_log logs/error.log info; #pid logs/nginx.pid; events { use epoll; worker_connections 51200; } http { include mime.types; default_type application/oc

  • Implementation in secondary domain 2010-02-24

    With the optimization of the depth and maturity of the Internet, two domain names and web sites for independent of the relationship between the primary domain name more and more subtle; this evolving trend will gradually mature. Which saw a lot of pe

  • Analysis of the request in the request nginx 2010-04-04

    ngx_http_init_request in the event the handler is initialized ngx_http_process_request_line, then the first call ngx_http_read_request_header to read the head, then began to call the function that ngx_http_parse_request_line on the request line parsi