国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

golang - 用Nginx反向代理部署go寫的網(wǎng)站。
習(xí)慣沉默
習(xí)慣沉默 2017-05-16 17:27:54
0
2
1018

這個是我的go語言專案(MVC)的path:/home/demo/goproj/src/Test 監(jiān)聽的是8080端口,Nginx的設(shè)定檔該怎麼寫呢? ?我配置了幾次還是不對。 " location /{} " 還是這樣寫" location /Test {}"

習(xí)慣沉默
習(xí)慣沉默

全部回覆(2)
伊謝爾倫

簡單版本:

location / {
  proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  proxy_set_header Host $http_host;
  proxy_redirect off;
  proxy_pass http://localhost:8080;
}

一般靜態(tài)檔案由 nginx 提供,所以可以這樣寫

root /home/demo/goproj/src/Test/public;
try_files $uri/index.html $uri.html $uri @goapp;

location @goapp {
  proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  proxy_set_header Host $http_host;
  proxy_redirect off;
  proxy_pass http://localhost:8080;
}
大家講道理
server {
    listen 80;
    server_name 123.com;

    location / {
    proxy_pass    http://127.0.0.1:8080;
    proxy_redirect default;
        }
}

如果有2級目錄則

        location /test {
        proxy_pass    http://127.0.0.1:8080;
        proxy_redirect default;
        }
最新下載
更多>
網(wǎng)站特效
網(wǎng)站源碼
網(wǎng)站素材
前端模板