2023-03-29
学习资料
00

通用NGINX反代设置

# HTTP反向代理相关配置开始 >>> location ~ /purge(/.*) { proxy_cache_purge cache_one $Host$request_uri$is_args$args; } location / { proxy_pass http://127.0.0.1:8008; proxy_set_header Host $Host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header REMOTE-HOST $remote_addr; proxy_connect_timeout 30s; proxy_read_timeout 86400s; proxy_send_timeout 30s; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; } # HTTP反向代理相关配置结束 <<<

禁用缓存加这两句

proxy_no_cache 1; proxy_cache_bypass 1;