go:挂webserver

apache配置:

<VirtualHost *:80>
    ServerName test.com
    DocumentRoot /home/q/system/Engine/src/biz/www

    ProxyRequests Off 
    <Proxy *>
        Order deny,allow
        Allow from all 
    </Proxy>
    ProxyPass /conf/ !
    ProxyPass /package/ !
    ProxyPass / http://127.0.0.1:8082/

    <IfModule mod_deflate.c>
        SetOutputFilter DEFLATE
    </IfModule>

    CustomLog "|/usr/local/apache2/bin/rotatelogs /usr/local/apache2/logs/access_log.%Y%m%d 86400 480" combinedio
</VirtualHost>

nginx配置:

server {
    listen       80;
    server_name  .a.com;

    charset utf-8;
    access_log  /home/a.com.access.log;

    location /(css|js|fonts|img)/ {
        access_log off;
        expires 1d;

        root "/path/to/app_a/static";
        try_files $uri @backend;
    }

    location / {
        try_files /_not_exists_ @backend;
    }

    location @backend {
        proxy_set_header X-Forwarded-For $remote_addr;
        proxy_set_header Host            $http_host;

        proxy_pass http://127.0.0.1:8080;
    }
}

见以下链接的nginx和apache部署:http://beego.me/docs/deploy/nginx.md

 

posted on 2015-01-29 20:17  awildfish  阅读(169)  评论(0编辑  收藏  举报

导航