官术网_书友最值得收藏!

  • NGINX Cookbook
  • Tim Butler
  • 89字
  • 2021-07-03 00:04:32

How to do it...

We'll create a separate NGINX configuration file with the server block in it, as follows:

server { 
    listen       80; 
    server_name  beegodemo.nginxcookbook.com; 
    access_log  /var/log/nginx/beegodemo-access.log  combined; 
    location = /favicon.ico { access_log off; log_not_found off; } 
    location / { 
         proxy_pass http://127.0.0.1:8080; 
         proxy_http_version 1.1; 
         proxy_set_header Upgrade $http_upgrade; 
         proxy_set_header Connection "upgrade"; 
    } 
} 

By default, a Beego application will listen on the localhost to port 8080. We simply proxy all connections though. Like the Express recipe, we also set the proxy headers to allow WebSockets to pass through as well.

主站蜘蛛池模板: 大田县| 峨山| 永济市| 临洮县| 龙海市| 磴口县| 姚安县| 拜城县| 曲阳县| 华宁县| 辉县市| 大同市| 玉田县| 潮安县| 东丰县| 黔西县| 广东省| 凉城县| 宁德市| 兴仁县| 鹤壁市| 天等县| 温宿县| 阜康市| 凤城市| 铁力市| 凤凰县| 神农架林区| 沽源县| 简阳市| 乌审旗| 平果县| 高唐县| 乳山市| 丽水市| 禄劝| 龙江县| 南华县| 大庆市| 鲁山县| 德昌县|