一些nginx配置文件备份
备份一些nginx相关配置文件。
emby反向代理
resolver 8.8.8.8 ipv6=off;
set $proxy_url {{要反代的地址}};
client_max_body_size 5000M;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For '$proxy_add_x_forwarded_for';
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Sec-WebSocket-Extensions $http_sec_websocket_extensions;
proxy_set_header Sec-WebSocket-Key $http_sec_websocket_key;
proxy_set_header Sec-WebSocket-Version $http_sec_websocket_version;
proxy_cache off;
proxy_redirect off;
proxy_buffering off;
location / {
proxy_pass $proxy_url;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_ssl_verify off;
proxy_http_version 1.1;
proxy_set_header Host $http_host;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_read_timeout 86400;
proxy_send_timeout 86400;
}
location ~* \.(gif|png|jpg|css|js|woff|woff2)$
{
proxy_pass $proxy_url;
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;
expires 12h;
}
chatgpt api反向代理
location / {
proxy_connect_timeout 600s;
proxy_send_timeout 600s;
proxy_read_timeout 600s;
proxy_set_header Referer api.openai.com;
proxy_set_header Host api.openai.com;
proxy_pass https://api.openai.com;
proxy_set_header Accept-Encoding '';
chunked_transfer_encoding off;
proxy_ssl_server_name on;
proxy_set_header Connection '';
proxy_http_version 1.1;
proxy_buffering off;
proxy_cache off;
}
禁止访问指定后缀文件
以db文件为例:
location ~ (.db)$ {
return 404;
}
看看其他吧