全部博文(2065)
分类: LINUX
2010-11-08 21:40:29
apache配置二级域名
时间:2010-11-8
1. apache配置文件如下
NameVirtualHost *:8000 Listen 8000 DocumentRoot "E:/abc" ServerName Options Indexes FollowSymLinks AllowOverride All Order allow,deny Allow from all
|
然后我修改hosts文件内容如下:
192.168.0.105
访问:
这样访问的话还需要加上一个端口号。如何达到不用输入端口号呢?
2. 结合nginx 实现代理转发
配置如下
server { listen 80 default backlog=1024; server_name ; server_name_in_redirect off; output_buffers 32 128k; postpone_output 1460; client_header_buffer_size 16k; large_client_header_buffers 4 8k; request_pool_size 4k; location / { proxy_pass proxy_read_timeout 600; proxy_redirect off; proxy_buffer_size 32k; proxy_buffers 4 32k; client_max_body_size 10m; client_body_buffer_size 128k; proxy_set_header Host $host; proxy_set_header Accept-Encoding none; proxy_set_header X-Forwarded-For $remote_addr; } } |