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