美文网首页
nginx部署beego项目

nginx部署beego项目

作者: 懒人程序猿 | 来源:发表于2020-03-20 19:40 被阅读0次

nginx配置如下

server {
        listen       80;
        server_name  www.beego.cn beego.cn;

        charset utf-8;
        access_log  /Users/username/go/log/beego.log;

        location /(css|js|fonts|img)/ {
            access_log off;
            expires 1d;
            root "/Users/username/go/src/quickstart/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部署beego项目

      本文链接:https://www.haomeiwen.com/subject/nddsyhtx.html