From d7fbbb1700e6360ddfce25e1290c32ad8f7aaa4f Mon Sep 17 00:00:00 2001 From: fantasticit Date: Tue, 28 Jun 2022 21:37:39 +0800 Subject: [PATCH] chore: update nginx.conf --- nginx.conf.sample | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/nginx.conf.sample b/nginx.conf.sample index fca91b57..f2b36de7 100644 --- a/nginx.conf.sample +++ b/nginx.conf.sample @@ -43,16 +43,23 @@ server { } location /think/wss { - proxy_pass http://think_wss; - proxy_read_timeout 300s; - proxy_send_timeout 300s; + proxy_pass http://think_wss; + proxy_read_timeout 300s; + proxy_send_timeout 300s; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_http_version 1.1; - proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection 'upgrade'; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection 'upgrade'; + } + + location /static/ { + gzip_static on; + expires max; + add_header Cache-Control public; + alias /apps/think/packages/server/static/; } }