在服务器端我的博客是http://127.0.0.1:8080/blog下面的,我想通过nginx的反向代理到blog.codeif.com的域名下

比如原来文章的url是http://127.0.0.1:8080/blog/article/123


server {  

    listen      80;  

    server_name  blog.codeif.com;  

    location / {  

        rewrite ^/(.*)$ /blog/$1 last;  

    }  

   

    location ~* ^/blog/.*$ {  

        proxy_pass http://127.0.0.1:8080;  

    }  

}