|
|
- location ^~ /
; U5 O1 W$ q& k! E$ M - {
5 y& s4 _( o- \+ ^" ~) k: ^ - proxy_pass http://localhost:13000;
! U( H6 ? W3 Q, F& `8 ] - proxy_set_header Host $host;- G* o/ J0 a) w( V. s) G
- proxy_set_header X-Real-IP $remote_addr;% L1 R: H) ^4 e4 E4 c
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;0 o, q# Z1 T( |
- proxy_set_header X-Forwarded-Proto $scheme;; t4 J c. e2 s: [: H: O) Q0 p1 b; V
- proxy_set_header X-Forwarded-Host $http_host;
3 [! L! x7 U2 s$ w/ L! m6 q% v - proxy_set_header X-Forwarded-Port $server_port;4 l+ U( N* U1 f
- proxy_set_header REMOTE-HOST $remote_addr;
0 F3 ]; F; m0 F! k3 w) T - proxy_set_header REMOTE-PORT $remote_port;
3 u5 m& y2 S1 E" a3 w8 N0 x& e - proxy_set_header Upgrade $http_upgrade;5 q- P0 Q4 L! D) H
- proxy_set_header Connection $connection_upgrade;, l% s% s( u& p2 S: Z* G
- proxy_http_version 1.1;; e/ }7 l8 U! M, [
- add_header X-Cache $upstream_cache_status;
: g* g5 q5 U$ I- w9 i - & V2 w1 R6 r) z- P! }; g' I* g
- set $static_fileL7Oj3VcR 0;
- n& v2 I: f6 l8 m0 U - if ($uri ~* "\.(gif|png|jpg|css|js|woff|woff2)$") {, M# O; [0 X/ F4 t6 s
- set $static_fileL7Oj3VcR 1;. G1 p, L, z# e( L
- expires 1m;( G$ E% }7 o4 z$ |0 _
- }1 o- ~3 V( y8 L1 i. b0 v# ?5 Q F
- if ($static_fileL7Oj3VcR = 0) {
( \: M5 g) d" _' N3 {2 y - add_header Cache-Control no-cache;- E; N2 f2 e# g4 N& O2 A. B( B
- }( G9 b& y! ^3 [6 y4 p/ Z: r
- }
复制代码 |
|