# nginx反代示例
## ChatGPT
```nginx
location / {
proxy_ssl_server_name on;
proxy_pass https://new.oaifree.com;
proxy_set_header Host new.oaifree.com;
}
location /auth/login_auth0 {
proxy_ssl_server_name on;
proxy_pass https://new.oaifree.com;
proxy_set_header Accept-Encoding ""; # 禁用压缩
sub_filter_once on;
sub_filter '</body>' '<script>
!function(){const e=document.querySelector("div.ulp-alternate-action");let t=!1;function o(t,o,n){const r=e.cloneNode(!0),a=r.querySelector("p"),l=a.querySelector("a").cloneNode(!0);a.textContent=t,l.textContent=o,l.onclick=n,l.href="#",a.appendChild(l),e.parentNode.insertBefore(r,e.nextSibling)}function n(e){fetch("/api/share/auth/openai/login_user_key?user_key="+e).then(e=>e.json()).then(e=>{e.success?window.location.href="/auth/login_oauth?token="+e.data:Swal.fire("Error",e.data,"error").then(()=>{window.location.reload()})}).catch(()=>{Swal.fire("Error","没有可用的帐户。请稍后再试。","error").then(()=>{window.location.reload()})})}o("No account? ","Use custom system account",e=>(e.preventDefault(),Swal.fire({customClass:{inputLabel:"bold-label"},input:"textarea",inputLabel:"使用系统账号登录",inputPlaceholder:"请输入一个访问 Token(任意字符,用于会话隔离,未防止回话泄露,请使用较为复杂的 Token)",inputAttributes:{"aria-label":"请输入一个访问 Token"},showCancelButton:!0,showLoaderOnConfirm:!0}).then(e=>{e.isConfirmed&&e.value&&(userKey=e.value.trim(),localStorage.setItem("user_key",userKey),n(userKey))}),!1));const r=document.querySelector("#submit-token");o("Got account? ","Continue with Access Token",e=>{e.preventDefault(),t=!0,r.click(),t=!1}),e.remove(),r.lastChild.textContent="Continue with System Account",r.addEventListener("click",e=>{if(t)return;e.preventDefault(),e.stopPropagation(),Swal.showLoading();let o=localStorage.getItem("user_key");return o||(o="rd_"+"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=16*Math.random()|0;return("x"==e?t:3&t|8).toString(16)}),localStorage.setItem("user_key",o)),n(o),!1},!0)}();window.addEventListener("load",function(){Swal.fire({title:"<strong>使用教程</strong>",icon:"",width:"80%",html:`<h3>第一步</h3><br>\n <img height="300" src="https://s21.ax1x.com/2024/07/01/pkcjAvq.png">`,showCloseButton:!1,showCancelButton:!1,focusConfirm:!1,confirmButtonText:`Great!`})});
</script>
</body>';
此文件已被截断。 显示原始文件